HTML td scope attribute
Examples
The following two examples of the <th> element is identified as a column header, the two <th> element is identified 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"
Browser Support
scope attribute no visual effects in an ordinary Web browser, but you can use screen readers.
Definition and Usage
HTML5 does not support the <td> scope attribute.
scope attribute defines the form of tables method head unit with a data unit is associated.
Scope attribute identifies whether a cell is a column, row, column or row group header group.
grammar
<td scope="col|row|colgroup|rowgroup">
Property Value
值 | 描述 |
---|---|
col | 规定单元格是列的表头。 |
row | 规定单元格是行的表头。 |
colgroup | 规定单元格是列组的表头。 |
rowgroup | 规定单元格是行组的表头。 |
HTML <td> tag