Obsolete scope attribute
Silktide checks for scope attributes placed on ordinary table data cells. The scope attribute describes what a heading applies to, so it belongs on heading cells only; on a data cell it is obsolete and can mislead assistive technologies.
In , scope is defined for <th> heading
cells. Putting it on a <td> data cell usually means one of two things: the
cell really is a heading and should be a <th>, or the attribute is left
over from old markup and should be removed.
<!-- Problem: scope on a data cell -->
<td scope="col">Name</td>
Why this matters
A builds its picture of a
table from the markup. A scope attribute on a data cell is a contradictory
signal: the element says "I am data" while the attribute says "I label other
cells". Different resolve that contradiction
differently - some ignore the attribute, others treat the cell as a heading -
so the table can be announced with wrong or inconsistent headings depending
on what software the visitor uses.
How to fix it
Decide what the cell really is:
- If it acts as a heading, change it to a
<th>and keep a validscopevalue (row,col,rowgroup, orcolgroup):
<!-- Fixed: the heading is a real heading cell -->
<th scope="col">Name</th>
- If it is ordinary data, remove the
scopeattribute entirely:
<!-- Fixed: plain data cell -->
<td>Name</td>
How Silktide tests this
- Find every table cell on each page.
- Report each
<td>data cell that carries ascopeattribute, whatever its value.