Patient Guy wrote:
> In my reading of the Strict and Transitional DTD for HTML 4.0, the table
> row (TR) elements are contained within table section elements: THEAD,
> TFOOT, and TBODY.
> The table section elements are the defined contents of the TABLE element.
> The TR element is not defined as an "immediate" or "direct" contained
> element of TABLE.
> Given that
> i. the use of the table section elements is optional, but that
> ii. TBODY is implicit when no table section elements are specified with an
> HTML table,
> what does an HTML parsing agent (browser) do when tree-building from a
> TABLE node and it encounters a TR element without having encountered any
> table section element?
> Does it:
> 1. append the TR element node to the TABLE node?
> 2. examine for the presence of a table section node, and failing to find
> one instantiated, perform the following steps in this order:
> a. instantiate a TBODY element node
> b. append it to the TABLE node
> c. create the TR element node
> d. append the TR node to the TBODY node
> e. continue reading the HTML and develop the table according the
> Corrections to my reading of the HTML DTD are warmly appreciated.
Sources I read say that <tbody> and the like are mandatory. The indentation
and purification tool called 'tidy' insists on it too.
However, W3C validators do not insist on it (at least XHTML, but I think
others too from what I can recall). The question is then whether you want
your page to validate safely or also remain a stickler. Then again,
validators evolve... just make sure you specify a version number which