[html5] validator.nu and empty table tr

Jukka K. Korpela jukka.k.korpela at kolumbus.fi
Tue Nov 30 09:11:00 PST 2010


Ingo Chao wrote:

> Isn't this conforming?
> <table><tr></tr></table>

It conforms to current HTML 5 drafts.

> Error: Row 1 of a row group established by a tbody element has no
> cells beginning on it.

Apparently validator.nu plays its own game, using existing HTML 
recommendations rather than HTML 5 drafts in this issue.

> But ...
> table content model: ... either zero or more tbody elements or one or
> more tr elements
> tr content model: Zero or more td or th elements

I guess the HTML 5 drafts deviate from previous versions of HTML because 
they wish to allow a table row with no cells to be specified, with the 
intent of filling the row dynamically with client-side scripting. I wonder 
why. If you intend to add the cells dynamically, why can't you start by 
adding the row element?

Disallowing tr elements with no content may help against accidental errors 
(assuming people use software that checks the document syntax). It hardly 
causes any harm. If you really want to have a dummy row, you can use 
<tr><td></td></tr>.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 




More information about the Help mailing list