Atribut lingkup <th> HTML
Contoh
Tentukan bahwa dua sel header adalah header untuk kolom:
<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>
Definisi dan Penggunaan
Atribut scope
menentukan apakah sel header adalah header untuk kolom, baris, atau grup kolom atau baris.
Catatan: Atribut scope
tidak memiliki efek visual di browser web biasa, tetapi dapat digunakan oleh pembaca layar.
Dukungan Peramban
Attribute | |||||
---|---|---|---|---|---|
scope | Yes | Yes | Yes | Yes | Yes |
Sintaksis
<th scope="col|row|colgroup|rowgroup">
Nilai Atribut
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 |
tag <th> HTML