The HTML scope attribute
Quick answer
The HTML scope attribute declares whether a header cell applies to a row, column, or group. It is used on the <th> element.
Overview
The scope attribute states what a table header cell labels. It is used on table cells (<th>, <td>) and columns.
It defines table structure — spanning cells across rows or columns, and connecting data cells to their headers. These attributes are central to making data tables understandable to screen-reader users.
Syntax
<th scope="col">Name</th>
Values
| Value |
|---|
| row | col | rowgroup | colgroup |
Best practices
Accessibility
Adding scope to header cells is the simplest way to make a data table accessible — screen readers use it to announce the relevant header when reading each cell.
Frequently asked questions
What does the scope attribute do?
States what a table header cell labels.