469,950 Members | 2,317 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

create table

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
3 2187
Atli
5,058 Expert 4TB
Only thing I notice is that you didnt close the </table> tag
Jan 19 '07 #2
Oh ya, i forgot to close the TABLE tag .. But after correcting this error, it still doesn't work..
Jan 19 '07 #3
drhowarddrfine
7,435 Expert 4TB
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.

Similar topics

4 posts views Thread by Michael Jackson | last post: by
7 posts views Thread by Wolfgang Kreuzer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.