Re: function and impacts (was: @scope and @headers reform)

Laura Carlson 2008-09-23 10.52:

> A comment in the HTML 4 specification DTD fragment for td and th[1]
> was clear that if a cell was both a header and contained data, then
> authors should use td:
> 
> <!-- TH is for headers, TD for data, but for cells acting as both use TD -->
> 
> This is also clarified in the section on associating header
> information with data cells [3]:
> 
> "Note that it's not always possible to make a clean division of cells
> into headers or data. You should use the TD element for such cells
> together with the id or scope attributes as appropriate."
> 
> I've always believed it was a mistake that the headers attribute is
> allowed on th element in HTML 4, as requiring a header must mean the
> cell contains data.


This comment about that "mistake" of HTML 4 puzzled me. But I see 
how you are reasoning: Because the cell has another cell as its 
header, you are judging that the cell has to be a data cell.

But I have to express deep concern over this understanding.

As you know, I agree with you about the need for being able to 
reference TD cells in the headers attribute. However, the view 
that any TH cell which also has the @headers attribute, ought to 
have been a TD cell, would really maximise that need, if I can put 
it that way. (In such system, there could in fact not be more than 
one TH per row and one TH per column.)

HTML 4 must here be read together with its @headers-incorporating 
algorithm for locating heading information for individual cells. 
If the algorithm finds a TD cell after a TH cell, then the 
algoritm stops. So, if you have a TH cell on the 5th row, there 
would be no method for incorporating the TH cell on the 1st row in 
the list of header cells, unless - for the 5th row cell - you were 
allowed to write  <th headers=ID-of-Firstrow-Cell>heading</th>.

The @headers-incorparating algorithm of HTML 4 also means that if 
the TH cell appears on the 2nd, then the TH on the 1st row would 
be a header of TH on the 2nd row header. According to your logic, 
then, this would have to be yet another mistake of HTML 4: that TH 
on the 2nd row really ought to have been a TD as well.

It is in the HTML 4 @headers-incorporating algorithm that such 
combined header/data cells can be labeled with the category 
attribute: @axis. Then they can stay as TD cells - yet still be 
treated as TH cells (and thus be automatically included) in the 
@headers-incorporating algorithm. Meaning that you often would not 
need to use @headers to reference that <td axis=1stcategory> cell, 
except in "edge" case. (And those edge cases would increase even 
more as long as @axis is not included in the logic of it all.)

Clearly this was no mistake of HTML 4. If fact, if one says that 
@headers on the TH cell was a "mistake", then one is also saying 
that the entire @headers-incorparating algorithm of HTML 4 was a 
mistake as well. Such a view would, in practise, also be a strong 
vote for @scope as the preferred method.

The problem with HTML 5, as it now stands, is this: We are 
discussing a @headers which is hanging in the air. @headers 
without the @headers-incorporating algorithm really is something 
else than what @headers in HTML 4 is. The question of whether 
@headers should be allowed to reference TD-s really is wholly 
other question as long as @axis is not part of the picture!

In my view, defending @headers without understanding and defending 
- possibly developing - the @headers-incorporating algorithm of 
HTML 4, is like cutting the branch one is sitting on. It is the 
straight way to @he** - uh - @scope.

In a way, as long as HTML 5 does not include @axis, it is simply 
logical to say that one should use TH cells for those cells.

Why? Well look at this simplfied table:

<tr><th id=a>     head 1    </th><th       >head 2</th>
<tr><td id=b>     axis 1    </td><td axis=1>axis 2</td>
<tr><td headers="a b">data 1</th><td       >data 3</td>
<tr><td headers="a b">data 2</th><td       >data 4</td>

In the first column, I do not use @axis.  Then I must repeat the 
@headers info in each TD cell in order to be able to references it 
and because @headers trumphs @scope. This nullify the assumed 
advantage of @scope.

In the second column, I added @axis instead and get a much more 
simple and less error prone result, which is covered by the 
@headers-incorporating algorithm. In order to get the same kind of 
simplicity *without* @axis, it would be logical to use TH - 
whether or not one goes for @scope or @headers!

In summary: without @axis and without the @headers-incorporating 
algorithm of HTML 4, I really am in doubt about what to do with 
the need to reference TD cells with @headers.
-- 
leif halvard silli

Received on Tuesday, 23 September 2008 12:35:50 UTC