create table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Starlite
    New Member
    • Jan 2007
    • 15

    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
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Only thing I notice is that you didnt close the </table> tag

    Comment

    • Starlite
      New Member
      • Jan 2007
      • 15

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

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        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.

        Comment

        Working...