HTML th scope attribute
Examples
The two header cell is defined as a column header:
<table border="1">
<tr>
<th></th>
<th scope="col">Month</th>
<th scope="col">Savings</th>
</tr>
<tr>
<td>1</td>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>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>1</td>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>2</td>
<td>February</td>
<td>$80</td>
</tr>
</table>
try it"
Browser Support
scope attribute no visual effects in an ordinary Web browser, but you can use screen readers.
Definition and Usage
scope attribute specifies whether a header cell is a column, row, column or row group header group.
Differences between HTML 4.01 and HTML5
no.
grammar
<th scope="col|row|colgroup|rowgroup">
Property Value
值 | 描述 |
---|---|
col | 规定单元格是列的表头。 |
row | 规定单元格是行的表头。 |
colgroup | 规定单元格是列组的表头。 |
rowgroup | 规定单元格是行组的表头。 |
HTML <th> tag