0Pricing
Web Accessibility Academy · Aula

Cabeçalhos de linhas e colunas bem definidos

Associe cada célula aos cabeçalhos corretos.

Cabeçalhos de linhas e colunas bem definidos é uma aula grátis de Web Accessibility Academy no CoddyKit. Esta é a aula 2 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Web Accessibility Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Web Accessibility Academy inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em inglês.

Most Tables Have Two Header Types

Real data usually has headers along the top and down the side. Each data cell sits at the crossing of a column header and a row header.

Every Cell Needs Both

The value 92 means little alone. Tie it to Ada and to Score and it becomes Ada, Score, 92. That pairing is the association you are building.

Column Headers Across the Top

The first row holds scope=col headers. As a user arrows down a column, the screen reader keeps announcing that column header for context.

<tr>
  <th scope="col">Student</th>
  <th scope="col">Score</th>
</tr>

Row Headers Down the Side

The first cell in each body row becomes a scope=row header. It names the row so values get a who or a when as the user reads across.

<tr>
  <th scope="row">Ada</th>
  <td>92</td>
</tr>

The Corner Cell

The top-left cell often sits above row headers and beside column headers. Leaving it as an empty th is fine and keeps the grid honest.

<tr><th></th><th scope="col">Score</th></tr>

Default scope Is a Trap

Browsers try to guess scope, but the guess is unreliable for anything beyond the simplest grid. Always set scope yourself to be sure.

Use thead and tbody

Wrap header rows in thead and data rows in tbody. It clarifies structure for assistive tech and makes your markup far easier to read.

<thead>
  <tr><th scope="col">Name</th></tr>
</thead>
<tbody>
  <tr><th scope="row">Ada</th></tr>
</tbody>

How a Screen Reader Reads It

Move to a data cell and the user hears the row header, the column header, then the value. Good scope is what makes that announcement accurate.

One Header Cell, One Job

Keep a th to a single role: a column header or a row header. Mixing data and labels in one cell muddies the association for everyone.

Test by Reading One Cell

Pick a random data cell and ask: do its headers fully explain it? If you cannot tell what a number means from its headers, your scope is wrong.

A Two-Axis Example

Column headers on top, row headers on the left, data in the middle. This matrix shape covers the vast majority of tables you will build.

<tr><th scope="row">Ada</th><td>92</td><td>88</td></tr>

Quick Check

A user arrows onto a data cell deep inside a well-marked table.

Recap: Two Axes, Two Scopes

Column headers use scope=col, row headers use scope=row, and every data cell sits where they cross. Set scope yourself and never trust the guess.

Perguntas Frequentes

A aula “Cabeçalhos de linhas e colunas bem definidos” é grátis?

Sim — o texto completo de “Cabeçalhos de linhas e colunas bem definidos” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Web Accessibility Academy, atualize para CoddyKit PRO. O curso de Web Accessibility Academy inclui 4 aulas no total.

O que vou aprender em “Cabeçalhos de linhas e colunas bem definidos”?

Associe cada célula aos cabeçalhos corretos. Você pratica Web Accessibility Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar Web Accessibility Academy?

Nenhuma experiência prévia é necessária. Web Accessibility Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 2 de 4.

Quanto tempo leva a aula “Cabeçalhos de linhas e colunas bem definidos”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de Web Accessibility Academy?

Sim. Cada aula de Web Accessibility Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. th, scope e o elemento caption
  2. Cabeçalhos de linhas e colunas bem definidos
  3. Tabelas complexas: associação de headers e id
  4. Tabelas de layout são uma armadilha
← Voltar para Web Accessibility Academy