WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: <td> Vs <th> tags for use of scope attribute and headers in data tables

for

Number of posts in this thread: 2 (In chronological order)

From: Michael Burks
Date: Fri, Feb 10 2012 8:06AM
Subject: <td> Vs <th> tags for use of scope attribute and headers in data tables
No previous message | Next message →

All,

My apologies, I used the wrong subject line.




I am interested in what people think about using the <td> tag instead of the
<th> tag for row headers when using the scope attribute. This has been
recommended by the access board at
http://www.access-board.gov/sec508/guide/1194.22.htm#%28g%29

I think you should use the <th> tag. Any thoughts on this?



Sincerely,

Mike Burks

From: Jared Smith
Date: Fri, Feb 10 2012 8:21AM
Subject: Re: <td> Vs <th> tags for use of scope attribute and headers in data tables
← Previous message | No next message

On Fri, Feb 10, 2012 at 8:04 AM, Michael Burks wrote:

> I am interested in what people think about using the <td> tag instead of the
> <th> tag for row headers when using the scope attribute.

From a standards standpoint, it's a bit ambiguous in the HTML4/XHTML
specifications. Scope is allowed on both <th> and <td>, and the spec
states, "TH is for headers, TD for data, but for cells acting as both
use TD." Nearly all header cells (especially when there are both
column and row headers) could seemingly act as both.

In HTML5, the scope attribute is only allowed on <th> elements, not on <td>.

From a functional standpoint, the presence of <th> elements is a
primary mechanism used by browsers and assistive technologies to
identify and provide functionality for data tables, as opposed to
layout tables. It's been a few years since I tested, but I don't think
screen readers do anything special with scope on <td>s.

In short, if it's a header, use <th>.

Jared