HTML scope Attribute
Example
<table>
<tr>
<th scope="col">Heading</th>
<th scope="col">Heading</th>
</tr>
<tr>
<td>Table data</td>
<td>Table data</td>
</tr>
<tr>
<td>Foot data</td>
<td>Foot data</td>
</tr>
</table>
Meaning
The scope attribute specifies the table cells for which the current cell provides header information.
Values:
- A value of col indicates that the cell is a header for the rest of the column below it.
- A value of colgroup indicates that the cell is a header for its current column group.
- A value of row indicates that the cell contains header information for the rest of the row it is in.
- A value of rowgroup indicates that the cell is a header for its row group.
This attribute can be used in place of the header attribute and is useful for rendering assistance by nonvisual browsers.
Note: If the scope attribute is not specified, or its value is not row, col, or rowgroup, or colgroup, then browsers automatically select the set of cells to which the header cell applies.
Standard Syntax
<element scope="col|row|colgroup|rowgroup">
Browser Support
Status
Applies to:
The scope attribute can be used on the following element:
Attribute Values
Value | Description |
---|---|
col | The cell is a header for a column |
row | The cell is a header for a row |
colgroup | The cell is a header for a group of columns |
rowgroup | The cell is a header for a group of rows |