Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: Can TR element be direct child node of TABLE element?

[Follow-up ignored: cross-posted to clj, ah and ciwah. Follow-ups set
to ciwah]

Roy Schestowitz wrote:

Patient Guy wrote:

The TR element is not defined as an "immediate" or "direct"
contained element of TABLE.

In other words, a not a child but a descendant.

[snip]

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?

Well it depends. Will it encounter any table section elements?

If not, presumably an implementation will create a TBODY element and
place all table rows inside that element. For example, this is what an
implementation should do should a document dynamically create a TABLE
element via the DOM and insert a new row without first creating a TBODY.

If table section elements will be encountered, then we're talking
error correction and the user agent is likely to do anything.

[snip]

Sources I read say that <tbody> and the like are mandatory.

Yes, a TBODY element is mandatory, however its start and end tags are optional.


  "The TBODY start tag is always required except when the table
   contains only one table body and no table head or foot
   sections."

In the latter case, the table body should be created implicitly.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index