Complex TABLES (headers and IDs) or not - WCAG tutorial disambiguation

Hi,


I routinely refer to this excellent W3 site

https://www.w3.org/WAI/tutorials/

when coding TABLES.


I am hoping someone may be able to help provide me with some clarity regarding two examples from the tutorial pages, specifically regarding when a TABLE needs IDs and HEADERS.


This first example

https://www.w3.org/WAI/tutorials/tables/irregular/#table-with-two-tier-headers

the 'Mars and Venus' TABLE, is coded with SCOPEs and COLSPANs in order that it be accessible. No IDs or HEADERs. Sounds good.


The next page:

https://www.w3.org/WAI/tutorials/tables/multi-level/

at the top it sets out when to treat a TABLE as complex (needing IDs and HEADERs), specifically it says:


- - - begin - - -

> Tables with multi-level headers

> This page covers tables that have multi-level header cells associated per data cell. Such tables are too complex to identify a strict horizontal or vertical association between header and data cells. In such tables, each table header is represented by a (document-wide) unique id. Data cells refer to those ids by listing one or more in their headers attribute, separated by spaces.

> Tables that should be marked up this way include:

> Tables with column headers that repeat or change part-way through the table.
> Tables with three or more header cells associated with each data cell.

- - - end - - -

My confusion and reason for seeking advice is that the first example I link to above ('Mars and Venus') has TDs that are described by three THs. For example, the TD
50,000
relates to; 'Teddy Bears', 'Produced', and 'Mars'. That TABLE has no HEADERs and IDs. However a TD being related to three THs seems to fit the description from the second link above, and so there appears to be an argument that IDs and HEADERs should be used. The two examples seem to contradict each other.

Any advice about this apparent grey area would be most welcome; if it appears there may be an error in one of the W3 examples I will drop them a note.


Thanks for any comments.


Cheers,


Alan


-Alan Bristow
Web Programmer
Web services team
Elections Canada
alan.bristow@elections.ca

Received on Monday, 11 January 2021 16:31:38 UTC