Атрибут области <th> HTML
Пример
Укажите, что две ячейки заголовков являются заголовками для столбцов:
<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>
Определение и использование
Атрибут scope
указывает, является ли ячейка заголовка заголовком для столбца, строки или группы столбцов или строк.
Примечание. Этот scope
атрибут не имеет визуального эффекта в обычных веб-браузерах, но может использоваться программами чтения с экрана.
Поддержка браузера
Attribute | |||||
---|---|---|---|---|---|
scope | Yes | Yes | Yes | Yes | Yes |
Синтаксис
<th scope="col|row|colgroup|rowgroup">
Значения атрибутов
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>