Quote:
Originally posted by me'
and table (block) can only contain th, td or tr elements (all block).
|
Actually, the table element may contain very much more than that. Tables are structurally quite complicated and you can't easily represent them in a sequential manner, so there are lots of different things to represent their inherent structure. In [HTML4], tables may in fact only contain zero or one caption, thead and tfoot; zero or more of either col or colgroup (which means they are mutually exclusive); and one or more tbody. Tbodies require one or more tr but have optional opening tags, so in that way you may also use tr directly within the table, because the tobody is implicitly there even it you haven't written it in the source code.
In [XHTML1] however, the W3C had to accept that they made a mistake in HTML that they couldn't afford to correct in XHTML, and thus in XHTML, where elements may not be implicit, instead of requiring one or more tbodies they require either one or more tbodies or one or more tr. Tbody and tr are thus mutually exclusive (which they were not in HTML), and the XML document tree of an XHTML document does not contain a tbody in the cases of tr appearing as a direct child of the table.
And, actually, the table elements have an entirely own display model, which is somewhat alike the block model but not exactly.