1.10 For complex data tables, use mark-up to associate data cells and header cells
Contents
WAI checkpoint 5.2
Full WAI text: "For data tables that have two or more logical levels of row or column headers, use mark-up to associate data cells and header cells."
A data table contains information which is presented in tabular format, e.g. financial accounts, timetables, etc. Row and column headers describe the contents of table cells, providing context for the information contained in the table as a whole.
Headers must be defined by inserting the correct HTML attribute, which indicates the table structure in a non-visual way.
When the information contained in a table is organised in a structural hierarchy with headings and subheadings, it is said to have 'logical levels'. Each heading and subheading corresponds to a logical level.
You must define the structural hierarchy of the headers and their relationship with the data cells of a table.
Note: Tables are also used to control the layout of images and text on a web page. Tables used solely for this purpose are not data tables and do not require row and column headers.
Rationale
People who can scan a table visually make sense of the information structure by visually comparing row and column headers with the contents of the table cells. However, users of text-only browsers or screen readers rely on the headers to gain an understanding of the table structure.
If the relationship between headers and data cells is not correctly identified in the underlying HTML, the contextual information required to make sense of the structure of a table will be lost when it is read by a text only browser or screen reader, rendering the information in the table useless.
Directions and Techniques
Use the correct HTML mark-up for building tables
When writing HTML, use THEAD, TFOOT, and TBODY to group rows, COL and COLGROUP to group columns, and the "axis", "scope", and "headers" attributes, to describe more complex relationships among data. See the WAI recommended techniques on good HTML practice for defining logical relationships in tables
How you could check for this:
Test the page with a screen reader or an audio web browser
Doing this will tell you if the page is correctly coded as the speech synthesiser will read the contents of the table with the correct structure.
