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

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

From: Frank Ellermann <nobody@xyzzy.claranet.de>
Date: Wed, 28 Sep 2005 18:34:18 +0200
To: www-validator@w3.org
Message-ID: <433AC60A.331E@xyzzy.claranet.de>

Robert J. O'Hara wrote:

>>> So, should this be marked up in a different way,
>> Yes.
> And your suggestion is?

A simple idea could be to replace all <tr> by <tr><td></td>.

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

Number of rows determined by <tr>, here three, number of
columns determined by the required maximum (left to right)
to place all cells, here also three.

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

Probably derived from earlier concepts as found in nroff (?)

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

Testing my own theory: three <tr> => three rows.  The first
row needs three columns.  The first cell needs three rows,
implicitly using the first column in rows 2 and 3.  These
rows have therefore one implicit plus three explicit columns
resulting in a for 4x3-table.  Cell (1,4) isn't specified.

My browser says:   X X     Lynx almost agrees: Y X X
                 Y X X X                         X X X
                   X X X                         X X X

I've replaced your first X by Y for a more visual effect.

The GUI browser aligns the content of the first cell to the
middle of the available three rows, that's the second row.
Liam's bible says that valign="middle" used to be the default
for <td>, so that's fine and as expected.

Obviously the Lynx folks decided that they don't want some
valign-concept for text mode, so that's also fine.  The last
test step, ask  validator.w3.org  for a third opinion about
your table:

| This Page Is Valid XHTML 1.0 Strict!

There, all is well.  Minor validator nit, please add a Reset-
button to the "validate by direct input" form, something like
<input type="reset" class="hideme" /> for old browsers.  Bye
Received on Wednesday, 28 September 2005 16:44:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:46 UTC