Re: @headers on th too or just td?

Hi,

Dan Connolly 2008-06-26 22.55:

> On Thu, 2008-06-26 at 22:56 +0300, Robert J Burns wrote:
>> On Jun 26, 2008, at 9:49 PM, Dan Connolly wrote:
>> 
>> > I did a little investigation into ISSUE-20 table headers...
>> >  http://www.w3.org/html/wg/tracker/issues/20
>> > attached are a couple files I was trying to make
>> > into test cases.
>> >
>> > The first one is from relevant WCAG 2 technique that somebody
>> > referred me to...
>> >
>> > H43: Using id and headers attributes to associate data cells with  
>> > header
>> > cells in data tables from Techniques for WCAG 2.0
>> > http://www.w3.org/TR/WCAG20-TECHS/H43.html
>> >
>> > I played around with that and validator.nu which led
>> > me to discover that the current HTML 5 draft allows
>> > @headers on td but not on th.
>> >
>> > "The td element may have a headers content attribute specified."
>> >  -- http://www.w3.org/html/wg/html5/#the-td
>> >  Editor's Draft 25 June 2008
>> >
>> > I suppose that suffices as far as I know... I can't
>> > see any particular reason to use @headers on th, though
>> > this does suggest the example in the WCAG 2 techniques
>> > should get revised.
>> 
>> For authoring simplicity headers on TH cells is more important than  
>> headers on TD cells. In fact it would be better for document  
>> conformance to allow them only on TH cells than to allow them on TD  
>> cells. A properly specified data / header cell association algorithm  
>> will already associate data cells with the most immediate header  
>> cells. Allowing authors to associate those header cells with other  
>> header cells means that authors only add the IDREF to a few header  
>> cell rather than maybe thousands of data cells.
> 
> just when I thought I was starting to understand this stuff...
> now I'm totally confused.
> 
> In H43, how would a screen reader know that 15% goes with
> both "Exams" and "1" without a headers attribute
> on the <td>?

Currently, under HTML 4, the screen reader follows the "algorithm 
to find heading information" (Section 11.4.3 in HTML 4). The 
relevant section -- for H43 -- says:  "search upwards to find 
column header cells".

H43 says that @headers "allows screen readers to speak the headers 
associated with each data cell when the relationships are too 
complex to be identified using the th element alone or the th 
element with the scope attribute".

Unfortunately, the table example of H43 does not fit the tag, as 
it is a very simple table. (However, to the defencence of H43, the 
focus of H43 is what *screen readers* are capable of -- and not 
what the HTML spec has specified.)

There are complex/untypical tables which do need the @headers 
attribute in data cells. But I agree with Rob in that it is more 
important to allow @headers on TH cells than to allow @headers on 
data cells.

For instance, consider that the Homework cell had been a header 
for the entire table. If then the "Exams" cell had the attribute 
headers="h", then, when performing the "search upwards to find 
column header cells", both 1, Exams and Homework would have been 
found.
-- 
leif halvard silli

Received on Thursday, 26 June 2008 23:51:43 UTC