RE: Complex Tables and the TH element

Hi Terrence,

You sure had a lot of responses to this one. I would like to stick my neck
out and propose a general technique for data table markup. This terminology
has derived from conversations with Sailesh over months; I especially like
his terms "layered" and irregular to be used in a minute.

A data table is "simple" if there is at most one row and one column of
headers. These headers must be marked up with <th> and the scope attribute
is required only where the scope is ambiguous or unexpected. The scope of
the cell in row 1 column 3 is obviously "col"; if it is not, then use the
scope attribute to say scope="row". Always use the scope attribute on the
cell in row 1 column 1 because that cell could be either a row or column
header - unless it is blank in which case it should be <td>.

I know - you are interested in complex tables. Those data tables which are
not simple.

A complex table (one that is not simple) is "layered" (Sailesh' term) if for
every data cell, the heading cells are always in the same row and/or same
column as the data cell.  This includes spanning in important ways. If a
heading cell spans columns 3 through 5, than any data cell in column 3
through 5 has that heading in "its column".

Accessible markup for layered tables. This is the "neck sticking out" part.
It is appropriate to mark up layered tables with <th> for every heading cell
and scope only where ambiguous or unexpected. Today screen readers do not
respect this markup but they could and should. Basically they should read
all headings that change as you move from cell to cell and provide a key
command to announce all headings of any data cell. 

This concept of layered table actually includes the "classic" example of a
complex table requiring headers and id's
(http://www.jimthatcher.com/webcourse9.htm#wcf9.7) IF the cells indicating
cities were to span all columns - by the argument here, this would then be a
layered table and not require headers/id markup.

Finally a table is "irregular" (Sailesh again) if it is complex and not
layered. Then where data cells have headings not in their row and or column,
headers and id's must be used to specify ALL heading cells for that data
cell.

Jim
 
Accessibility Consulting: http://jimthatcher.com/ 
512-306-0931

-----Original Message-----
From: w3c-wai-ig-request@w3.org [mailto:w3c-wai-ig-request@w3.org] On Behalf
Of Terrence Wood
Sent: Wednesday, September 21, 2005 6:58 PM
To: WAI Interest Group
Subject: Complex Tables and the TH element


Greetings,

I am developing processes for converting complex financial documents to
valid, accessible HTML.

Traditionally, I have marked up tables where the first column is marked up
as a TH and set scope="row" for accessibility (and semantic meaning).

However, some of the documents I am working with are 5 column Statements
of Financial Position where the first two columns are estimated numbers,
followed by a column containing the row labels, and finishing with two
columns of actual numbers.

A quick perusal of the HTML 4.0 recommendation does not preclude me from
marking up the cells in column 3 as TH with scope="row". I am wondering if
anyone else has marked up documents in this manner, or can elighten me if
this is an abuse of HTML 4.0, or is aware that this presents a significant
barrier to assistive technologies?

kind regards
Terrence Wood.

Received on Wednesday, 28 September 2005 19:48:23 UTC