English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The scope attribute defines how the header cells and data cells in the table are associated. The scope attribute identifies the cell as a column, row, or a group of columns or rows header.
The following example identifies two <th> elements as column headers and two <td> elements as row headers:
<table style="width:100%" border="1> <tr> <th>Number</th> <th scope="col">Month</th> <th scope="col">Savings</th> </tr> <tr> <td scope="row">1</td> <td>January</td> <td>3100</td> </tr> <tr> <td scope="row">2</td> <td>February</td> <td>2180</td> </tr> </table>Test See ‹/›
IEFirefoxOperaChromeSafari
The scope attribute has no visual effect in ordinary web browsers, but it can be used with screen readers.
HTML5 The <td> scope attribute is not supported.
The scope attribute defines the method for associating header cells with data cells in a table.
The scope attribute indicates whether a cell is a column, row, column group, or row group header.
<td scope="col|row|colgroup|rowgroup">
Value | Description |
---|---|
col | Specifies that the cell is the header of a column. |
row | Specifies that the cell is the header of a row. |
colgroup | Specifies that the cell is the header of a column group. |
rowgroup | Specifies that the cell is the header of a row group. |