Special note to the VisualStudio Team, the IE team, and all web coders: Check the spec, the table
tag *does not* contain tr
tags, and hasn't since 1999! Tables must contain tbody
tags (and optionally thead
and tfoot
tags), and that's where the tr
tags go.
Ambiguous?
brianiac on 2006-03-14T21:20:51
<!ELEMENT TABLE - -
(CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
That doesn't look ambiguous at all. If it's wrong (as suggested by the example, and the XHTML 1.0 and 1.1 DTDs), why has it never been fixed? I mean, that is a major technical error.Ah...
brianiac on 2006-03-14T21:54:44
Start tag optional. *Sheesh*
That would appear to mean, if I don't read it wrongly, that you can drop explicit mention of TBODY, so that embedded TR tags are in an implied TBODY, if you don't mention one.<!ELEMENT TBODY O O (TR)+ -- table body -->
Start tag: optional, End tag: optional
Re:But TBODY is optional...
brianiac on 2006-03-14T21:53:09
I thought that XHTML 1.0's reliance on the HTML 4.0 spec was a problem here, but C.11. #2 seems to address this specifically:
User agents that access XHTML documents served as Internet media types text/xml, application/xml, or application/xhtml+xml can also use the XML DOM. Elements and attributes will be returned in lower-case. Also, some XHTML elements may or may not appear in the object tree because they are optional in the content model (e.g. the tbody element [emphasis added] within table). This occurs because in HTML 4 some elements were permitted to be minimized such that their start and end tags are both omitted (an SGML feature). This is not possible in XML. Rather than require document authors to insert extraneous elements, XHTML has made the elements optional. User agents need to adapt to this accordingly. For further information on this topic, see [DOM2]