HTML data tables
This technique relates to Success Criterion 1.3.1: Info and Relationships (Sufficient as a way to meet an unwritten technique).
The objective of this technique is to programmatically associate captions for data tables where captions are provided in the presentation. The caption for a table is a table identifier and acts like a title or heading for the table.
caption element is the appropriate markup for such text and it ensures
that the table identifier remains associated with the table, including visually (by
default). In addition, using the
caption element allows screen reading software
to navigate directly to the caption for a table if one is present.
Although WCAG 2.0 does not prohibit the use of layout tables, CSS-based layouts are
recommended in order to retain the defined semantic meaning of the HTML
table elements and to conform to the coding practice of separating
presentation from content. If a table is used for layout, the
is not used. The purpose of a layout table is simply to control the placement of
content; the table itself is “transparent" to the user. A
caption would "break"
this transparency by calling attention to the table. See F46: Failure of Success Criterion 1.3.1 due to using th elements, layout tables for details..
Resources are for information purposes only, no endorsement implied.
For each data table:
- Check that the table has content that is presented as a table caption.
- Check that the table includes a
- Check that the content of the
captionelement identifies the table.
- #1-3 are true.