Inappropriate Table Caption Check
Description
The “Inappropriate Table Caption Check” evaluates whether there is any <table>
element that includes a <caption>
but lacks proper header markups such as <th>
elements or associated header attributes like scope
, headers
, or aria-labelledby
.
Example outcome
I found 1 table without headers but that uses the <caption>
element.
Impact
- Visual Impairments: Without headers, data cells are read by screen readers without context, making the table meaningless. The
<caption>
sets the expectation of meaningful structure, which is then not fulfilled. - Cognitive Disabilities: Tables without headers can increase cognitive load and confusion. Users may struggle to associate data with its meaning without clear labeling.
Fixes
To address <table>
elements that include a <caption>
but lack headers:
- Locate the
<table>
element. - Add headers elements to it (i.e.,
<th>
elements) in the appropriate row(s) and / or column(s).
Resources
- WCAG 2.2: Understanding Success Criteria 1.3.1
- WCAG 2.2 Techniques: Technique F46: Failure of Success Criterion 1.3.1 due to using th elements, caption elements, or non-empty summary attributes in layout tables
- WebAIM: Semantic Structure: Regions, Headings, and Lists
- WebAIM: Creating Accessible Tables