0Pricing
Web Accessibility Academy · レッスン

複雑なテーブル:headersとidの組み合わせ

セル結合や多階層の見出しを持つテーブルを扱います。

「複雑なテーブル:headersとidの組み合わせ」はCoddyKit上の無料Web Accessibility Academyレッスンです。 これはレッスン3/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはWeb Accessibility Academy学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Web Accessibility Academyコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

When scope Is Not Enough

Some tables span cells or stack multiple header levels. Simple scope cannot describe a cell governed by two or three headers at once.

Spanned Headers Break Scope

A header that uses colspan to cover several columns confuses the simple model. The browser can no longer guess which cells it owns.

<th colspan="2" scope="colgroup">Q1</th>

The id and headers Pairing

For complex tables, give each th an id and point each td to its headers by id. This wires cells to headers explicitly, no guessing.

<th id="q1">Q1</th>

Listing Multiple Header ids

A data cell can name several headers in its headers attribute, separated by spaces. The reader announces them all in the order you list.

<td headers="ada q1">92</td>

A Worked Example

Give the row header and column header each an id, then reference both from the cell. Now the value is fully described across both axes.

<th id="ada" scope="row">Ada</th>
<td headers="ada q1">92</td>

scope=colgroup and rowgroup

For grouped headers, scope can be colgroup or rowgroup. Use these when one header spans a band of columns or rows above the detail headers.

<th colspan="2" scope="colgroup">2024</th>

Two Header Levels

A year header over month headers needs both levels described. With id and headers each cell can reference the year and the month together.

Keep ids Unique

Every id on the page must be unique. Duplicate header ids silently break the pairing, so a quick validator pass saves real pain later.

Order in headers Matters

List ids in the order you want them read, usually the broadest header first. The screen reader follows your order exactly when it announces.

<td headers="year2024 month-jan ada">92</td>

Simplify Before You Complicate

Before reaching for id and headers, ask if you can split one giant table into smaller simple ones. A simpler structure is almost always more accessible.

Verify in a Screen Reader

The id and headers technique is powerful but easy to mistype. Always confirm a few cells read correctly with a real screen reader, not just by eye.

Quick Check

A data cell is governed by both a row header and a spanned column header.

Recap: Explicit Pairing for Hard Tables

When spans or stacked levels defeat scope, give headers an id and reference them from each cell with headers. Keep ids unique and verify by ear.

よくある質問

「複雑なテーブル:headersとidの組み合わせ」レッスンは無料ですか?

はい。「複雑なテーブル:headersとidの組み合わせ」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Web Accessibility Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Web Accessibility Academyコースには全4レッスンが含まれています。

「複雑なテーブル:headersとidの組み合わせ」で何を学びますか?

セル結合や多階層の見出しを持つテーブルを扱います。 ブラウザで直接実行するハンズオンコードでWeb Accessibility Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Web Accessibility Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのWeb Accessibility Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン3/4です。

「複雑なテーブル:headersとidの組み合わせ」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このWeb Accessibility Academyレッスンでコードを書いて実行できますか?

はい。すべてのWeb Accessibility Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. th、scope、caption要素
  2. 行見出しと列見出しを正しく設定する
  3. 複雑なテーブル:headersとidの組み合わせ
  4. レイアウト用テーブルは落とし穴
← Web Accessibility Academyに戻る