W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > April to June 2004

RE: [techs] The TH Rule

From: Gregg Vanderheiden <gv@trace.wisc.edu>
Date: Mon, 10 May 2004 22:59:19 -0500
To: "'Chris Ridpath'" <chris.ridpath@utoronto.ca>, "'WAI WCAG List'" <w3c-wai-gl@w3.org>
Message-ID: <auto-000032543120@spamarrest.com>

This is great info Chris. 
Thanks much.

So if I read this correctly,  

1) presence or absence of TH tells us nothing reliably (although presence
"mostly" indicates data table)

2)  we have lots of things to encourage people to do regarding tables.
Including using TH  etc.  

3)  layout tables are still very prevalent

4)  there are tables that are mixed layout and data   

5) there are tables that are layout that cause problems if taken out of
table format.


Ouch.

Any specific recommendations for out guidelines?


 
Gregg

 -- ------------------------------ 
Gregg C Vanderheiden Ph.D. 
Professor - Ind. Engr. & BioMed Engr.
Director - Trace R & D Center 
University of Wisconsin-Madison 


-----Original Message-----
From: w3c-wai-gl-request@w3.org [mailto:w3c-wai-gl-request@w3.org] On Behalf
Of Chris Ridpath
Sent: Monday, May 10, 2004 1:43 PM
To: WAI WCAG List
Subject: [techs] The TH Rule


We've been looking at using the "TH" rule to differentiate different HTML
table types. The proposal is that all data tables must have TH elements
while all layout tables cannot have TH elements. This would make it easy for
assistive technologies to determine the table type and render the
information more accurately to the user.

I took an action to look at how this may impact tables as they are currently
used on the web.

As examples of real word tables, I used the Yalin Wang database of tables
[1].

Of the over 14000 tables in the database, I looked at a random sample of
about 2000 tables and graded them as layout or data. In most cases it was
easy to decide the table type but I discovered several tables that didn't
fit into either category. (If you're interested in grading these tables
yourself, I've written a small program to assist the process. Please contact
me for more info.)

In some cases, authors combined both data and layout into one table [2].
This is very confusing to the viewer and we should discourage this practice.
Use a table for one purpose only.

The majority of tables in use on the web are used for layout. In my sample
89% of the tables were layout, only 11% were data. We're asking authors to
use CSS instead of TABLE elements but the reality is that layout tables are
in wide use.

Only a very small number (< 1% in my sample) of layout tables use TH
elements. This is an improper use of TH when other markup such as a heading
or STRONG should be used [4]. Not a big problem but we should continue to
discourage authors from doing this.

Most data tables are missing TH elements. In my sample a whopping 87% of the
data tables were without TH elements. Most authors leave off the headings of
their data tables or mark one of the TD elements incorrectly as B or STRONG
[3]. We need to more strongly encourage authors to put TH elements into
their data tables.

Exceptions to the TH rule:

Tables are often used to layout form controls. This is a kind of layout
table but also acts like a data table because the cells can't be moved
without affecting their meaning [5]. In this type of table the TH elements
are not as necessary because each control has an associated label. I suggest
that tables used to layout form controls can have an optional row/column of
TH elements.

Tables are sometimes used to display "tables of contents" [6]. These are
really data tables but I don't think they require TH elements. A "table of
contents" is generally understood to include a title (e.g. chapter name)
associated with a location (e.g. page number). When the viewer encounters a
number within a table of contents they don't need to be reminded that this
is the page number, they already know that because of the table's purpose. I
suggest that tables used for "table of contents" purposes may have optional
TH elements.

Discussion:

All tables with only one row are layout tables.

The scope attribute must also be used with TH elements. In my testing with
Jaws 4.5 I noticed that the TH elements were not read with the data cells
unless the TH elements also had the scope attribute. I've heard that other
screen readers behave the same way. Assistive technologies should be able to
use the TH element alone but it appears that since the TH rule is not widely
used they have taken to use the scope attribute.

Cheers,
Chris

[1] http://www.math.harvard.edu/~ylwang/doc/webtablegrnd.zip
[2]
http://tile-cridpath.atrc.utoronto.ca/acheck/servlet/TDShowTable?file=www.ai
rtalk.com.schedule.shtml&tabid=06468
[3]
http://tile-cridpath.atrc.utoronto.ca/acheck/servlet/TDShowTable?file=www.wa
shingtonpost.com.wp-srv.sports.longterm.olympics1998.sport.figskate.articles
.figskate.htm&tabid=14018
[4]
http://tile-cridpath.atrc.utoronto.ca/acheck/servlet/TDShowTable?file=indust
ry.ebi.ac.uk.w2h.Doc.help.mangpage.html&tabid=05329
[5]
http://tile-cridpath.atrc.utoronto.ca/acheck/servlet/TDShowTable?file=www.bl
ackwellpublishers.co.uk.static.figure.htm&tabid=06819
[6]
http://tile-cridpath.atrc.utoronto.ca/acheck/servlet/TDShowTable?file=www.na
p.edu.books.0309070775.html.index.html&tabid=09837
Received on Tuesday, 11 May 2004 00:00:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:47:29 GMT