Re: HTML 4.01 DTD

>I was looking at the HTML 4.01 DTD at http://www.w3.org/TR/html4/strict.dtd
>to look at the table definition.

ELEMENT TABLE - -
     (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)
ELEMENT CAPTION  - - (%inline;)*     -- table caption --
ELEMENT THEAD    - O (TR)+           -- table header --
ELEMENT TFOOT    - O (TR)+           -- table footer --
ELEMENT TBODY    O O (TR)+           -- table body --
ELEMENT COLGROUP - O (COL)*          -- table column group --
ELEMENT COL      - O EMPTY           -- table column --
ELEMENT TR       - O (TH|TD)+        -- table row --
ELEMENT (TH|TD)  - O (%flow;)*       -- table header cell, table data
cell--

>This definition seems to me that a TR tag is not allowed to be a direct child of
>a TABLE tag. This surprised me... Also because when I validate a 4.01
>document with the w3c validator it says it is valid.
>Also what is this about the "- O", "O O" and "- -"? What does that mean?

That's the key - it is about are start and end tags optional (O) or required (-).
So we see that both tags for TBODY are optional. Hence you still have TBODY in your table without writing it in code.

Regards,
Rimantas
                                                                              
                                                                              
                                                                               
                                                                            

                
                                                                 

Received on Friday, 16 April 2004 05:11:33 UTC