scope-attr-valid
Web validation
scope attribute should be only used on permitted elements and have a valid value.The scope attribute connects header cells to the row or column they describe, letting assistive technology announce the correct header as users move through data tables. When the attribute appears on the wrong element or carries an unexpected value, screen-reader navigation may become confusing and inefficient. Following the permitted element–value pairs keeps table navigation predictable across browsers and assistive technology.
In HTML5 documents (<!DOCTYPE html>), the scope attribute is allowed only on <th> elements; older HTML versions also allowed it on <td>.
Allowed values for the scope attribute are: row, col, rowgroup, or colgroup.
Pass Patterns
Valid scope attributes
scope attributes are on allowed elements and have valid values.
<!DOCTYPE html>
<table>
<tr>
<th scope="col">Name</th>
<th scope="col">1 mile</th>
<th scope="col">5 km</th>
</tr>
<tr>
<th scope="row">Mary</th>
<td>8:32</td>
<td>28:04</td>
</tr>
</table>Fail Patterns
scope attribute on a <td> element
scope appears on a data cell, so assistive technology ignores it.
<!DOCTYPE html>
<td scope="row">8:32</td>Invalid scope value
The value is not one of the four permitted keywords, so the association breaks.
<!DOCTYPE html>
<th scope="column">Name</th>Try It Yourself
Using a screen reader
New to screen reader testing, or need a refresher?
Review this article first: Practical guides for using screen readers
- Load the page and open a screen reader, then move focus into the data table.
- Navigate between the rows and columns.
Expected result: When you move between cells, the screen reader announces the correct row and column headers.
Actual result:
scopeon a<td>: the screen reader ignores the attribute, so the header isn't announced.row/colvalues swapped: the screen reader's output is unpredictable and depends on how the table's other headers are defined.
FAQ
Why is this validation considered a best practice?
While not mandated by WCAG, properly scoped headers greatly improve keyboard and screen-reader navigation.
Why is this issue marked as Moderate?
Incorrect scope use usually confuses table navigation rather than blocking it entirely. Users can still reach every cell, but they may lose contextual information, forcing extra effort to understand the data, particularly for large tables or when using assistive technology.