0Pricing
Web Accessibility Academy · Lektion

th, scope und das caption-Element

Geben Sie einer Tabelle einen Titel und korrekte Kopfzellen.

th, scope und das caption-Element ist eine kostenlose Web Accessibility Academy-Lektion auf CoddyKit. Dies ist Lektion 1 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Web Accessibility Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Web Accessibility Academy-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

Data Tables Carry Meaning

A real data table shows relationships between rows and columns. Mark it up well and screen readers can announce which header each value belongs to.

A Plain Table Is Confusing

If every cell is just a td, a screen reader reads numbers with no context. The user hears values but never learns what they mean.

<table>
  <tr><td>Name</td><td>Score</td></tr>
  <tr><td>Ada</td><td>92</td></tr>
</table>

Header Cells Use th

Swap header cells from td to th. Now the browser knows those cells label the data, not hold it, and exposes them as headers.

<tr><th>Name</th><th>Score</th></tr>

Why th Changes Everything

A th element is announced as a header and can be tied to the cells it describes. That link is what gives lonely numbers their meaning.

The scope Attribute

Add scope to each th to say which cells it covers. The value is col for a column header or row for a row header.

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

scope=col for Top Headers

Use scope=col on the header at the top of a column. Every cell below it inherits that label as the user moves down.

<th scope="col">City</th>

scope=row for Side Headers

Use scope=row on the first cell of a row when it names that row, like a person or a date along the left edge.

<th scope="row">Ada</th>

caption Names the Table

The caption element gives the whole table a title. Screen reader users hear it first, so they know what they are about to explore.

<table>
  <caption>Quiz scores by student</caption>
</table>

caption Must Come First

Place caption as the very first child inside the table, right after the opening tag. Any other position is invalid and may be ignored.

Caption Beats a Heading

A nearby h2 is not enough. The caption is programmatically tied to the table, so users discover the title even when jumping table to table.

A Complete Simple Table

Caption, header row of th with scope, then data rows. This foundation makes most simple tables fully accessible with zero ARIA.

<table>
  <caption>Scores</caption>
  <tr><th scope="col">Name</th><th scope="col">Score</th></tr>
  <tr><th scope="row">Ada</th><td>92</td></tr>
</table>

Quick Check

You are labeling the column header at the top of a table.

Recap: The Three Building Blocks

You learned the trio of accessible tables: th for headers, scope to aim them, and caption to name the table. That is most of the job done.

Häufig gestellte Fragen

Ist die Lektion „th, scope und das caption-Element“ kostenlos?

Ja — der vollständige Text von „th, scope und das caption-Element“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Web Accessibility Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Web Accessibility Academy-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „th, scope und das caption-Element“?

Geben Sie einer Tabelle einen Titel und korrekte Kopfzellen. Du übst Web Accessibility Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Web Accessibility Academy zu starten?

Keine Vorkenntnisse erforderlich. Web Accessibility Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 1 von 4.

Wie lange dauert die Lektion „th, scope und das caption-Element“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Web Accessibility Academy-Lektion Code schreiben und ausführen?

Ja. Jede Web Accessibility Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. th, scope und das caption-Element
  2. Zeilen- und Spaltenüberschriften richtig einsetzen
  3. Komplexe Tabellen: headers- und id-Zuordnung
  4. Layouttabellen sind eine Falle
← Zurück zu Web Accessibility Academy