data table markup - minimal OK or need to specify headers?

Hi all,

I am working on some data tables and have come up with a few things that I wanted to get some feedback on. Apologies for the long email, just for anyone out there who is very interested in data tables! :)

I'm referring to these articles:

Roger Hudson "Accessible Data Tables"
http://www.usability.com.au/resources/tables.cfm

Joe Clark "Building Accessible Websites" Chapter 10
http://www.joeclark.org/book/sashay/serialization/Chapter10.html

W3C WAI HTML Techniques for WCAG 1.0
http://www.w3.org/TR/WCAG10-HTML-TECHS/#identifying-table-rows-columns
(see the example table immediately following the text "The following example shows how to create categories within a table using the "axis" attribute." (but ignoring the axis attribute)

Jim Thatcher's wai-ig post:
http://lists.w3.org/Archives/Public/w3c-wai-ig/2005JulSep/0213.html

Also useful is a feature in the Firefox Web Developer extension (version 1.0.1) under Information then "Display table information". This will display summary text, abbreviations for table headers, and what headers have been defined for a cell.

I've made three sample pages and have to decide between following one of the three approaches taken in these. (The information given in the table is identical in the three examples.)

http://www.reb.net.nz/tables/table1.html

This has minimal markup - horizontal and vertical headers are marked "th" but no associations are marked up between headers and data cells. 

Reading Jim Thatcher's post this seems OK, as none of the data cells in the table have headers not in their column or row. I'm a bit nervous about using this approach though, as its so little effort!

One thing that could be a problem with this markup, especially with different content, would be how you tell how many rows the header "Expenses" applies to. (All but the final row I would guess for this table, but the content rather than the markup tells me this.)

http://www.reb.net.nz/tables/table2.html

This has ALL applicable headers marked up for every th and td. Seems overly verbose especially as some of the layered headers seem unnecessary. For example, nobody needs to know that "Revenue - Crown" has the header "Revenue".

http://www.reb.net.nz/tables/table3.html

This is what I prefer. I've removed any header - cell association markup where this wouldn't give any extra useful information.

Note the differences between the lists of headers for data cells in the "Expenses" and "Revenue" sections.

Small note here - Joe Clark sort of does this, in his book chapter link given above, there is some table HTML following the text "The most specific id of each row is the last one, so the other two could be left out". 

Trimming the lists of headers given as he has done in this example is wrong, eg for headers="males-ns-grade" you would only get the header information "Grade school" not "Males, Nova Scotia, Grade school" - unless the parent headers are also given by the user agent. Does anyone know if this is the case?

And just a few assumptions about what I'm not asking about:

This is not a question about how to write the "summary" attribute.

I'm using id and headers rather than scope to associate headers with data cells (due to screen reader support as explained in Roger Hudson link.) 

Where a cell both HAS a header and functions AS a header for other cells, in most cases I'm marking this as a td not a th. (see WCAG techs link.)

Any thoughts on any of this? I'm most interested in what people think of the three options.

Many thanks,
Rebecca  

Received on Thursday, 2 February 2006 05:43:59 UTC