W3C home > Mailing lists > Public > www-validator@w3.org > September 2005

Re: Validator and/or correct markup for empty table row

From: Robert J. O'Hara <rjohara@post.harvard.edu>
Date: Wed, 28 Sep 2005 02:43:51 -0400
Message-ID: <433A3BA7.2090602@post.harvard.edu>
To: www-validator@w3.org
CC: "Jukka K. Korpela" <jkorpela@cs.tut.fi>

Jukka K. Korpela wrote:

>> (There is a validation link at the bottom of the page.)
> 
> It's an icon of the type that _claims_ validity. Such claims are worse 
> than useless, even when true.

(It's too early in the morning for you, Jukka. ;-)  If we want to be 
philosophers: The icon-qua-icon is a claim of validity, and the act of 
following the icon-qua-link tests the claim. On several hundred other 
pages on which I make the claim it is true; I just discovered that on 
this page it is false, which is why I am trying to fix it. ;-) And since 
adding the icon-as-claim a couple of days ago led me to test the claim 
via the W3C validator (the BBEdit validator I had used previously 
recognized no error), the icon and its link have indeed been useful, and 
not useless, as a matter of empirical fact.

>> that is a possibility, but I have heights set on rows and cells to 
>> maintain an approximately linear scale,
> 
> That would be better done in CSS by setting the heights there.

That is exactly what I do.

>> So, should this be marked up in a different way,
> 
> Yes.

And your suggestion is?

>> Or should the validator and the specifications be altered to accept 
>> empty <tr>s iff they are subsumed under rowspans?
> 
> A validator could not be changed to accept empty <tr>s _conditionally_,
> to the extent that the validator is a validator, i.e. checks the syntax 
> against a DTD, since a DTD cannot express such conditionality. That 
> would go far beyond the simple metalanguage used when writing DTDs.

But the DTD is full of conditionality. Is the markup <td>some text</td> 
valid? It is if it is contained within a <tr></tr>, but not otherwise, 
and even if it is contained within a <tr></tr>, the nested pair is only 
valid if they are contained within a <table></table>.

 >> You might say that the rows should simply be deleted;
 >
 > Yes. Or some cell(s) should be put there. As a matter of logic, these
 > are the only alternatives to achieve validity when using the HTML DTDs
 > in specifications.

 >> or should this be considered perhaps a flaw in the specifications,
 >
 > Hardly.

I am getting at a deeper issue in the nature of data tables, which you 
aren't recognizing. It seems to me this is a conceptual deficiency in 
the (X)HTML table model and the way <tables>s are validated; but perhaps 
you disagree. (I'm not talking about just algorithmic validation per se, 
but the spirit of the process, which is to ensure that a meaningful data 
structure, presumed to be embodied in the DTD, is present in a 
particular document and is recognized there by the validator.)

Consider this table, which, when properly embedded in other elements, 
will pass the vaildator:

<table>
<tr> <td></td> <td></td> <td></td> </tr>
<tr> <td></td> </tr>
<tr> <td></td> <td></td> </tr>
</table>

How are we to understand the data being represented here? This (valid) 
markup seriously underdetermines what the table says, and even whether 
it can possibly make sense. Unless one adds rowspan and/or colspan 
attributes somewhere and begins to constrain what relationships are 
being represented, the table above might mean dozens on different things 
(represented here as ascii layouts):

<table>
<tr> <td></td> <td></td> <td></td> </tr>
<tr>                     <td></td> </tr>
<tr> <td></td>           <td></td> </tr>
</table>

<table>
<tr> <td></td> <td></td> <td></td> </tr>
<tr>           <td></td>           </tr>
<tr>           <td></td> <td></td> </tr>
</table>

<table>
<tr> <td></td> <td></td> <td></td> </tr>
<tr> <td>                    </td> </tr>
<tr> <td></td> <td>          </td> </tr>
</table>

In a logical sense, data tables are fundamentally made up not only of 
rows but also of columns, but the (X)HTML table model, as embodied in 
the DTD and as verified by the validator, is only about rows. That seems 
to me to be a deficiency.

In other words: the following is *wrong*, and it should also be 
recognized as formally invalid:

<table>
<tr> <td rowspan="3">X</td> <td>X</td> <td>X</td> </tr>
<tr> <td>      X      </td> <td>X</td> <td>X</td> </tr>
<tr> <td>      X      </td> <td>X</td> <td>X</td> </tr>
</table>

(Too early for Jukka, too late for me. Can't think any more tonight.)

RJO (rjohara.net)
Received on Wednesday, 28 September 2005 06:52:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:20 GMT