2 ms·
Fun fact: `table > tr` is actually valid HTML. > […] followed by either zero or more tbody elements or one or more tr elements […] — https://html.spec.whatwg.
by chrismorgan 4y ago
Fun fact: `table > tr` is actually valid HTML.
> […] followed by either zero or more tbody elements or one or more tr elements […]
— https://html.spec.whatwg.org/multipage/tables.html#the-table-element https://html.spec.whatwg.org/multipage/tables.html#the-table..., the table element, content model.
Sure, the HTML syntax will imply it (and https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions https://html.spec.whatwg.org/multipage/syntax.html#element-r... mentions this, how in HTML syntax `table > tr` is invalid), but this means that in XML syntax <table><tr><td/></tr></table> is actually valid.
I believe XHTML compatibility is the reason for this. But I have no real idea quite why XHTML 1.0 decided to allow (tbody+|tr+) (basically a mixture of HTML 3.2 and HTML 4) rather than tbody+ like HTML 4.