[html5] validator.nu and empty table tr

Ian Hickson ian at hixie.ch
Tue Mar 1 16:19:16 PST 2011


On Thu, 2 Dec 2010, Henri Sivonen wrote:
> Ian Hickson wrote:
> > On Tue, 30 Nov 2010, Jukka K. Korpela wrote:
> > > >
> > > > 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.
> > 
> > More likely it's just a bug.
> 
> The code in question mostly predates the spec and has been extrapolated 
> from this expression of Hixie's opinion at one point in time: 
> http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2006-October/007430.html

I don't see anything about empty rows there. :-)


> I thought the spec at least at some point banned empty rows. Am I 
> mistaken or has the spec changed?

I am not sure.


> Why aren't empty rows banned?

So that you can fill them in later, as in:

   <table>
    <caption>First three results</caption>
    <tfoot>
     <tr id="headers">
    <tbody
     <tr id="row1">
     <tr id="row2">
     <tr id="row3">
   </table>
   <script>
    // get results
    // fill in table
   </script>

Note though that as currently specified, the table _would_ be in error if 
any of the rows had a cell in it, since then there'd be rows consisting 
entirely of empty slots.

(It's possible that I misspoke in the original thread; I don't recall if 
the table had any cells in it. If it did, then the validator isn't wrong.)


> Not banning <ul></ul> makes sense, but once you have 
> <table><tr></tr></table>, you might as well require it to be 
> <table><tr><td></td></tr></table>, since this requirement isn't more 
> substantially more onerous to authoring tools but helps catch 
> unintentionally empty rows.

I don't really see why it would be different. I do agree tables make this 
a little more complex since they're two-dimensional.

The way I look at this is that the goal is trying to catch likely 
authoring errors. This:

   <table>
    <tr> <td>bla bla </tr>
    <tr> <td>bla bla blaa <tr> <!-- notice typo here -->
    <tr> <td>bla </tr>
   </table>

...is a likely error, whereas a table with no cells (even if it has 
tables) seems highly unlikely to be an error.

However, the best thing to do here would be to look at real data. Do you 
have logs for these kinds of errors? Are they common? Are they 
false-positives? Do we get many false-negatives? (Presumably the latter 
question would require additional instrumenting of the code.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the Help mailing list