RE: HTML Table Markup

> We agreed ... that layout tables cannot use TH elements.

Yes.

> We agreed that data tables must use TH elements.

No, not all, but this was the question I am seeking clarification on!

First of all, <q>identify row and column headers</q> encompasses other techniques.  I include a message below that Andrew Kirkpatrick sent me (that was meant to get posted to the IG list) which has some very nice examples of this.

Does 5.1 require only _changing_ TD to TH (or other technique) or does it go so far to require the _addition_ of whole rows?

It may be that this comes down to parsing the word "use".  I do NOT believe that there is consensus on this point.  I have checked the mail archive and minutes for previous discussion on this point.  There has been plenty of discussion (on-going for years actually) on this, but nothing definitive that I could find (nor recollect).  If I am mistaken on this point, please provide a telling URL!

When I first posted the start of this thread, I thought I was asking an easy question!

I now believe that this is one of those ambiguities endemic to WCAG1.  Those endemic ambiguities are, of course, part of the motivation for the continuing work on WCAG2.

If we agree that data tables absolutely require use TH (or other technique) we must do so with consideration of very simple data tables.  I gave the example of a 3x2 table with three names and three phone numbers.  Do we want 5.1 to require the addition of a heading row in this case?

I am comfortable if this IS the consensus.  I just want the point fully considered.  If this is the case, the techniques document should be updated with the example of adding a header row.

Thanks.


-----Original Message-----
From: Andrew Kirkpatrick [mailto:andrew_kirkpatrick@wgbh.org]
Sent: Saturday, September 04, 2004 8:44 PM
To: w3c-wai-ig@w3.org; Bailey, Bruce
Subject: RE: Does 5.1 absolutely require TH?

Bailey, Bruce wrote:
> So, does 5.1 necessarily require the _addition_ of TH?

5.1 States: For data tables, identify row and column headers.

I'm imagining Bruce on the stand for some case, being asked, "is it
necessary to use table header elements to identify table headings, or can it
be done any other way?"  Or he's talking to a developer who's trying to
justify why something they've done meets the guidelines.

So if I do the following, is it 100% clear what the headings are?
<table>
<tr>
<td scope="col">A</td><td scope="col">B</td>
</tr>
<tr>
<td>foo</td><td>bar</td>
</tr>
</table>

What if I did this?
<table>
<tr>
<td id="a">A</td><td id="b">B</td>
</tr>
<tr>
<td headers="a">foo</td><td headers="b">bar</td>
</tr>
</table>

How about:
<table>
<thead>
<tr>
<td>A</td><td>B</td>
</tr>
</thead>
<tbody>
<tr>
<td>foo</td><td>bar</td>
</tr>
</tbody>
</table>

This one would be clear to a sighted person, shouldn't assistive
technologies be able to pick up on something of this sort?
<style>
.z font-weight: bold;
</style>
<table>
<tr>
<td class="z">A</td><td class="z">B</td>
</tr>
<tr>
<td>foo</td><td>bar</td>
</tr>
</table>

The HTML recommendation states:
(http://www.w3.org/TR/1999/REC-html401-19991224/struct/tables.html#h-11.2.6)
The TH element defines a cell that contains header information.
And...
The headers and scope attributes also allow authors to help non-visual user
agents process header information.

More...
(http://www.w3.org/TR/1999/REC-html401-19991224/struct/tables.html#non-visua
l-rendering)
For a given data cell, the headers attribute lists which cells provide
pertinent header information. 
And...
For a given header cell, the scope attribute tells the user agent the data
cells for which this header provides information. 

So to answer the question, I believe that table header elements are not
necessary, however they are pretty darn clear for a human developer looking
at the code to understand.  It is also convenient for applying styles. In
reality, we are concerned with what works with existing assistive
technologies, so we might not implement one of the examples above because it
may not work (or because we'd need to spend the time to test it out).  

AWK

Andrew Kirkpatrick
Project Manager, WGBH National Center for Accessible Media
125 Western Avenue
Boston, MA 02134
617.300.4420 

Received on Thursday, 9 September 2004 19:48:57 UTC