HTML <th> atributo de escopo

❮ Tag HTML <th>

Exemplo

Especifique que as duas células de cabeçalho são cabeçalhos para colunas:

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

Definição e uso

O scopeatributo especifica se uma célula de cabeçalho é um cabeçalho para uma coluna, linha ou grupo de colunas ou linhas.

Observação: o scopeatributo não tem efeito visual em navegadores comuns, mas pode ser usado por leitores de tela. 


Suporte ao navegador

Attribute
scope Yes Yes Yes Yes Yes

Sintaxe

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

Valores de atributo

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