HTML <td> scopeAttribute
Example
The following example marks the two <th> elements as column headers, and the two <th> elements as row headers:
<table border="1">
<tr>
<th></th>
<th scope="col">Month</th>
<th scope="col">Savings</th>
</tr>
<tr>
<td scope="row">1</td>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td scope="row">2</td>
<td>February</td>
<td>$80</td>
</tr>
</table>
<tr>
<th></th>
<th scope="col">Month</th>
<th scope="col">Savings</th>
</tr>
<tr>
<td scope="row">1</td>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td scope="row">2</td>
<td>February</td>
<td>$80</td>
</tr>
</table>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
The scope attribute has no visual effect in ordinary web browsers, but can be used by screen readers.
Definition and Usage
HTML5 does not support the <td> scope attribute.
The scope attribute defines a method for associating header cells with data cells in a table.
The scope attribute identifies whether a cell is a header for a column, row, column group, or row group.
Syntax
<td scope="col|row|colgroup|rowgroup">
Attribute Values
| Value | Description |
|---|---|
| col | Specifies that the cell is a header for a column. |
| row | Specifies that the cell is a header for a row. |
| colgroup | Specifies that the cell is a header for a column group. |
| rowgroup | Specifies that the cell is a header for a row group. |
HTML <td> Tag Other Extensions