WebAIM - Web Accessibility In Mind

E-mail List Archives

RE: Why do we need 'Scope' attribute?

for

From: Thomas Jedenfelt
Date: Jul 19, 2005 2:01AM


Jim,

Technically speaking, HTML 4.01 Spec. says:
'TH is for headers, TD for data, but for cells acting as both use TD'.

So, the below code would be preferred:
(capital letters and no closing tags used for clarity)

<TR>
<TH scope="col">Column A
<TH scope="col">Column B
<TR>
<TD scope="row">1 A
<TD>1 B
<TR>
<TD scope="row">2 A
<TD>2 B

Regarding User Agent's (UA) behaviour,
I do not know whether:
1) <TD scope="row">
2) <TH scope="row">
3) <TH>
are rendered differently (in benefit for the user).

As for your clients:
Tell them that Section 508 (1194.22) suggests using
<TH scope="col"> and <TD scope="row">. [1]

I'm sure your clients will accept '508' as authority, whether or not '508' is in fact correct (technically/UA behaviour).

Also, the more complex something is, the more your clients will view you as an expert, to your credit <smile>.

Finally, 'scope' might become (more?) useful in future UAs/browsers (compare HTML vs. XHTML).

Regards,
Thomas Jedenfelt

[1]
http://www.access-board.gov/sec508/guide/1194.22.htm#(g)

Further reading:
http://www.w3.org/TR/html4/struct/tables.html#adef-scope
http://www.w3.org/TR/html4/struct/tables.html#h-11.4
http://www.w3.org/TR/WCAG10-HTML-TECHS/#identifying-table-rows-columns
http://www.webaim.org/techniques/tables/2#scope


----- Original Message -----
From: "Jim Thatcher"
Date: Mon, 18 Jul 2005 21:35:19 -0500

> This is a very troubling question for me. Today screen readers assume the
> first row and the first column are headers with no markup whatsoever. Well,
> to be good citizens, we add TH's on those table cells that are headers even
> though the screen readers don't need them. But the scope attribute? I
> believe the ONLY cell that needs a scope attribute is the cell in the first
> row and first column, cell 1,1, because that corner cell could either be a
> row header or a column header (or neither). What scope could the TH in row
> 1, column 7 have besides scope="col".
>
> I advise clients to use TH and scope - but darn it, it is redundant and
> unnecessary - even silly!
>
>
> Jim
> Accessibility Consulting: http://jimthatcher.com/


--

Surf the Web in a faster, safer and easier way:
Download Opera 8 at http://www.opera.com