HTML <th > Bereichsattribut
Beispiel
Geben Sie an, dass die beiden Überschriftenzellen Überschriften für Spalten sind:
<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>
Definition und Verwendung
Das scope
Attribut gibt an, ob eine Überschriftszelle eine Überschrift für eine Spalte, Zeile oder Gruppe von Spalten oder Zeilen ist.
Hinweis: Das scope
Attribut hat in gewöhnlichen Webbrowsern keinen visuellen Effekt, kann aber von Screenreadern verwendet werden.
Browser-Unterstützung
Attribute | |||||
---|---|---|---|---|---|
scope | Yes | Yes | Yes | Yes | Yes |
Syntax
<th scope="col|row|colgroup|rowgroup">
Attributwerte
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 group of columns |
rowgroup | Specifies that the cell is a header for a group of rows |
❮ HTML <th>-Tag