By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,447 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,447 IT Pros & Developers. It's quick & easy.

create table

P: 15
Hi, I've already written a simple XML and CSS file. My aim is to display the information in table form.

For example:


Apple Orange
Watermelon Banana


But i don't know why my codes just simply don't work. Wonder what is the problem.

XML code:

<TABLE>
<ROW>
<CELL ROWSPAN="1" COLSPAN="1">
<para>
Apple</para>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<para>
Orange</para>
</CELL>
</ROW>
<ROW>
<CELL ROWSPAN="1" COLSPAN="1">
<para>
Watermelon</para>
</CELL>
<CELL ROWSPAN="1" COLSPAN="1">
<para>
Banana</para>
</CELL>
</ROW>

CSS code:

TABLE { display:table;}
ROW { display:table-row; }
CELL { display:table-cell;}

Instead of printing it in table form, the output i obtained is:

Apple
Orange
Watermelon
Banana
Jan 19 '07 #1
Share this Question
Share on Google+
3 Replies


Atli
Expert 5K+
P: 5,058
Only thing I notice is that you didnt close the </table> tag
Jan 19 '07 #2

P: 15
Oh ya, i forgot to close the TABLE tag .. But after correcting this error, it still doesn't work..
Jan 19 '07 #3

drhowarddrfine
Expert 5K+
P: 7,435
Which browser are you testing in? Some of that css won't work in old, buggy non-standard IE7 or lesser versions. You should also remember that case matters in xml and css and you should use lower case.

Also, there is no such attribute as "rowspan" or "colspan" in XML. There is no such thing as a table element either.

Tables are never to be used for layout in html but you are trying to duplicate tables in an even more advanced mark up language. Except for pure data, you should get away from this tables mentatlity.

In any case, as I said, the problem may be your use of css that doesn't work in the browser you are testing in.
Jan 19 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.