Atrybut zakresu HTML <th>

❮ Znacznik HTML <th>

Przykład

Określ, że dwie komórki nagłówka są nagłówkami kolumn:

<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>

Definicja i użycie

Atrybut określa , scopeczy komórka nagłówka jest nagłówkiem kolumny, wiersza czy grupy kolumn lub wierszy.

Uwaga: Atrybut scopenie ma efektu wizualnego w zwykłych przeglądarkach internetowych, ale może być używany przez czytniki ekranu. 


Obsługa przeglądarki

Attribute
scope Yes Yes Yes Yes Yes

Składnia

<th scope="col|row|colgroup|rowgroup">

Wartości atrybutów

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

❮ Znacznik HTML <th>