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

On Tue, 27 Sep 2005, Robert J. O'Hara wrote:

> As I understand the specification, every <tr> must contain a cell of some 
> kind.

Yes. And that's a requirement presented in the DTD, which is all that 
matters in validation.

> The <tr>s of these two rows do not, and so the validator kicks up an 
> error.

Right. Note that since the document is syntactically malformed, 
HTML specifications assign no meaning to it, and browsers may do whatever 
they like with it.

> (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.

> 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.

> 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. You could 
use height attributes in HTML too, but that's clumsy and restricts you to 
pixel values. In CSS, you could use the em unit in order to have the 
heights automagically scaled to match the font size.

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

Yes.

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

Hardly.

> 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.

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

Received on Wednesday, 28 September 2005 04:51:59 UTC