Re: Formal definition of HTML5 (was Re: Version information)

On 17/04/07, James Graham <jg307@cam.ac.uk> wrote:
> I believe HTML4 also requires that the tbody be present in the DOM but I'm not
> sure where it says that in the spec.

The HTML4 spec says it like this:

~~~~
<!ELEMENT TABLE - -
     (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
/.../
Start tag: required, End tag: required
~~~~
and
~~~~
<!ELEMENT TBODY    O O (TR)+           -- table body -->

Start tag: optional, End tag: optional
~~~~

In other words, TR is not an allowed child of TABLE in HTML4, but it's
allowed as child of TBODY and TBODY has optional start and end tags.
So, there is always an implicit TBODY in HTML4. This is not true of
XHTML1 because XML serialisation doesn't allow optional tags.
-- 
David "liorean" Andersson

Received on Tuesday, 17 April 2007 16:50:32 UTC