12. Tables
Accessibility Requirements
- WCAG SC 1.3.1 Info and Relationships: Information, structure, and relationships conveyed through presentation can be programmatically determined or are available in text.
- WCAG2 SC 4.1.2 Name, Role, Value: For all user interface components (including but not limited to: form elements, links, and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.
Test Method Rationale
For assistive technology (AT) users, data tables must explicitly associate table data with table row and column headers via programmatic markup. Table markup also facilitates navigation for AT users by providing programmatic landmarks via column and row headers.
When <table>
elements are used for layout purposes, data table structure elements such as row/column headers, captions, or table summaries are not permitted.
Limitations, Assumptions, Exceptions
- Data tables are tables where information in a cell requires a row and/or column header to adequately describe the cell’s contents. If a table is used for placement of content for visual aesthetics, it is considered a layout table.
- Some content may visually appear to require a data table structure, but linearizing the content reveals that the content is understandable without the table. These elements use styling methods to present content in columns or rows. The information conveyed does not rely on programmatic relationships between column or row headers to be understood. This content is not a data table and should not have associated programmatic table attributes. It should be tested using other baseline tests, such as 13. Structure and/or possibly 10. Forms) (assocated instructions).
- Rows of data that are related must have a row header so assistive technology users can understand the relationship of the row’s data cells. Not every table requires a row header. For example, a calendar month is a data table, typically with the days of the week as column headers. The dates in a row are not related so typically, there is no row header present. However, if there was a cell in each row to indicate the week of the month, this cell would serve as a row header for the dates within that row.
- Complex data tables are tables that have any one or more of these elements: multiple columns of row headers, multiple rows of column headers, and split or merged cells. These tables must incorporate formatting that establishes programmatically determinable relationships.
12.A Test Procedure for Data Table Roles
Baseline Test ID: 12.A-DataTableRole
Identify Content
All content/data visually presented in a table with column and/or row headers where the content is not in a meaningful sequence when linearized.
Note: Linearization of table content is the presentation of a table’s two-dimensional content in one-dimensional order of the content in the source, beginning with the first cell in the first row and ending with the last cell in the last row, from left to right, top to bottom.
Test Instructions
- Check that each data table has programmatically assigned a table role. [SC 4.1.2]
- Check that each data cell is programmatically assigned a data cell role. [SC 4.1.2]
- Identify all column and row headers for each data cell. Check that each header cell is programmatically assigned a role of header. [SC 4.1.2]
Test Results
If any of the above tests fail, Baseline Test 12.A-DataTableRole fails.
12.B Test Procedure for Data Table Header Association
Baseline Test ID: 12.B-DataTableHeaderAssociation
Identify Content
For any data table identified in 12.A, identify all column and row headers for each data cell.
Test Instructions
- Check that all data cells are programmatically associated with relevant header(s). [SC 1.3.1]
Test Results
If any of the above tests fail, Baseline Test 12.B-DataTableHeaderAssociation fails.
12.C Test Procedure for Layout Tables
Baseline Test ID: 12.C-LayoutTable
Identify Content
All content/data visually presented in a table that retains a meaningful sequence when linearized.
Note: Linearization of table content is the presentation of a table’s two-dimensional content in one-dimensional order of the content in the source, beginning with the first cell in the first row and ending with the last cell in the last row, from left to right, top to bottom.
Test Instructions
- Check that the table used purely for layout purposes does NOT include data table heading elements and/or associated attributes (e.g., row or column headers, summary, caption, scope). [SC 4.1.2]
Test Results
If any of the above tests fail, Baseline Test 12.C-LayoutTable fails.
Advisory: Tips for Streamlined Test Processes
- Content that is presented with a table appearance, but does not rely on header association, can most easily be identified by linearization. Another helpful indicator is the table only has row headers or column headers but not both.
- Baseline Tests 12.A and 12.C should be performed for each data table.
WCAG 2.2 Techniques
The following sufficient techniques were considered when developing this test procedure for this baseline requirement:
- F46: Failure of Success Criterion 1.3.1 due to using the elements, caption elements, or non-empty summary attributes in layout tables
- F49: Failure of Success Criterion 1.3.2 due to using an HTML layout table that does not make sense when linearized
- H43: Using id and headers attributes to associate data cells with header cells in data tables
- H51: Using table markup to present tabular information
- H63: Using the scope attribute to associate header cells and data cells in data tables
- PDF6: Using table elements for table markup in PDF Documents
- PDF20: Using Adobe Acrobat Pro's Table Editor to repair mistagged tables