<thead>要素
Technical Summary
theadは、親のtableに属する列見出しと関連する補助cellの行グループを表します。直接のtable childとして0個または1個を置き、captionとcolgroupの後、table body・tfoot・table直下のtrより前に配置します。
theadはrow groupであり、見出しcellを表すthとは別の構造です。HTML-AAMはnative theadをrowgroup roleへ対応付けます。各cellの見出しroleやdata/header relationshipはth、td、scope、headersを含む別の規則で評価します。
定義・配置・content model
| 項目 | 仕様上の定義 | 条件・範囲 |
|---|---|---|
| 意味 | 列見出しと補助cellを含むrow group | cell自体のheader/data semanticsとは区別する |
| 配置先 | tableの子 | captionとcolgroupの後。table body、tfoot、table直下のtrより前。直接の子は最大1個 |
| content model | 0個以上のtrとscript-supporting elements | 各行のcellはtdまたはthを含められる |
| 開始タグ・終了タグ | 開始タグは必須 | 直後がtbodyまたはtfootなら終了タグを省略できる |
| DOM interface | HTMLTableSectionElement | tbody・tfootと共有する |
| 固有属性 | 定義なし | global attributesを利用できる |
HTMLの適合性とparser recoveryは分けて扱います。parserが不正な入力からDOMを作れたことは、その入力が適合するHTMLであることを意味しません。
thead、th、table model
| 要素 | 構造上の役割 | cell semantics |
|---|---|---|
thead | 見出し部分の行グループ | sectionだけでは各cellを見出しcellにしない |
th | row内のcell | header cell。scopeやheader-assignment algorithmが適用関係を決める |
tbody | 表本体の行グループ | 中のthはrow headerなどとして使える |
td | row内のcell | data cell |
HTML Standardのthead定義は、列見出しの行に加えて補助的なnon-header cellを含む場合を認めます。したがって、行の所属先だけで見出し関係を推定せず、実際のcell要素とtable modelを確認します。
複雑な表では、thのscope、id、headers、row/column groupおよびcell spanが関係します。theadというsection名だけで全cellの関連先や読み上げ順を決めることはできません。
parserが作るDOM
<table id="schedule">
<tr><th scope="col">曜日</th></tr>
</table>
// HTML parserが構築するDOM
table#schedule
└─ tbody (暗黙に挿入)
└─ tr
└─ th
table insertion modeで、table childとして適合するsectionの外にtr tokenが現れると、tree builderはtbodyを暗黙に挿入してtokenを再処理します。cellがthであることを理由にtheadは推定されません。適合するauthoring markupでは、見出し行の親としてtheadを明示します。
HTMLTableSectionElementとtable API
| member | 戻り値・動作 | 範囲・境界 |
|---|---|---|
table.tHead | 最初の直接子theadを返す | 該当要素がなければnull |
table.createTHead() | 既存の最初のthead、または新しいsectionを返す | 新規作成時はcaption・colgroupの後へ挿入する |
table.deleteTHead() | 最初の直接子theadを削除する | 存在しない場合は何もしない |
thead.rows | section直下のtrを含むHTMLCollection | 行の追加・削除を反映するlive collection |
thead.insertRow() / deleteRow() | section内の行を追加・削除する | indexはsection内の行に対して解釈する |
const table = document.querySelector("table");
const head = table.tHead; // 既存のthead。なければnull
const sameHead = table.createTHead(); // あれば同じ要素を返す
head.rows.length; // thead内のtrの数
table.rowsはtable全体の行collection、thead.rowsはheader sectionの行collectionです。似た名前でも、対象範囲が異なります。createTHead()はsectionを作るAPIであり、thや行の内容までは作りません。
Accessibility mapping
HTML-AAMはnative theadをWAI-ARIAのrowgroup roleへ対応付けます。これはheader row groupの構造を示し、列見出しcellのroleを代わりに与えるものではありません。header cellはthと、そのscopeやtable header-assignment規則を基に区別します。
本ページのAAM実測はChromeのbrowser role/name queryです。これはHTML-AAMの規範的mappingそのものでも、Windows UI Automationなどplatform APIの記録でも、支援技術の読み上げ観測でもありません。
Fact / Evidence(主張 / 根拠)
規範的な仕様上の主張、AAMのmapping、選定環境における実装結果を別々に記録します。
| 種別 | Fact / 主張 | 条件・範囲 | 状態 | 根拠 |
|---|---|---|---|---|
| SPEC | theadはtable childとして最大1つ置け、caption・colgroupの後、tbody・tfoot・table直下のtrより前に置く。content modelはtrとscript-supporting elements。 | 要素定義、順序、tag omission、HTMLTableSectionElement interfaceを含む。 | 仕様確認済み | HTML Standard: the thead element |
| SPEC | table直下のtr tokenをtable insertion modeで処理する際、parserはtbodyを挿入する。thを含む行であってもtheadを推定しない。 | HTML parserの構築・recoveryと、authoring conformanceを区別する。 | 仕様確認済み | HTML Standard: in table insertion mode |
| SPEC | HTML-AAMはnative theadをrowgroup roleへ対応付ける。 | 規範的mappingとbrowser Accessibility tree、platform API、assistive technology出力を区別する。 | 仕様確認済み | HTML-AAM: thead |
Evidence
- HTML Standard: The
theadelement — context, content model, tag omission, and section interface - HTML Standard: The
tableelement — table child structure and table APIs - HTML Standard: The “in table” insertion mode — implied tbody insertion and token reprocessing
- HTML Accessibility API Mappings:
thead— rowgroup mapping - Web Platform Tests:
the-thead-element/rows.html— section row collection - Web Platform Tests:
the-table-element/tHead.html— table.tHead behavior
Implementation Evidence
仕様上の要求、選定環境のbrowser観測、WPT実行、Accessibility role/name queryを分けて記録します。各結果は記載したfixture・browser・test範囲に限られます。
| 種別 | 再現確認の範囲 | 記録条件 | 状態 |
|---|---|---|---|
| IMPL | HTMLTableSectionElement、table.tHead、createTHead() / deleteTHead()、thead.rows / insertRow() / deleteRow()、table parserの直接tr処理と終了tag省略 |
2026-10-17 JST / Chrome UA 155.0.0.0(Windows NT 10.0 UA)/ viewport 1920×911 / navigator.language=en-US。build-config/yugien/research-results/thead-v1/をloopback 127.0.0.1:4198で表示し、fixture checks 14/14 pass。section interface、table.tHead、既存headでのcreateTHead()、挿入位置、行collection、row API、parserが直接trにtbodyを補う挙動、許可された終了tag省略を確認。Chrome 1環境のみ。別browser、OS build、platform APIは未測定。 |
部分観測(Chrome 155 / fixture 14/14) |
| WPT | thead.rowsとtable.tHead / section APIに関する選定WPT |
2026-10-17 JST / Chrome UA 155.0.0.0 / wpt.live。rows.html 1/1 pass、tHead.html 3/3 pass。合計4/4 pass。wpt.liveが配信した正確な上流revisionは固定できていない。選定外test、他browserは未実施。実測時のテスト版は未記録です。リンク先の内容は変わることがあり、当時と同じテストで再確認できるとは限りません。 |
選定test 4/4成功(wpt.liveの版は未固定) |
| AAM | Chrome browser role/name queryによるnative table、row group、row、column header、row header、data cellの公開 | 2026-10-17 JST / Chrome UA 155.0.0.0(Windows NT 10.0 UA)/ viewport 1920×911 / navigator.language=en-US。fixtureのnamed table Quarterly revenueをqueryし、table 1、rowgroup 3(thead、tbody、tfoot)、row 4、columnheader 2、rowheader 2、cell 3を確認。browser role queryによる観測であり、Windows UI Automationなどのplatform APIとスクリーンリーダー発話は未測定。 |
部分観測(Chrome 155 browser role query / 1環境) |
Coverage / Open Issues
- SPEC要素の意味、配置条件、content model、tag omission、DOM interface、table parser、table API、HTML-AAM role mappingを確認
- IMPLfixtureとChrome 1環境に限定。別browser・OS build・印刷時のheader group behaviorは未測定
- WPT選定testのみ実行。wpt.liveが配信した上流revisionは未固定で、他browserとdirectory全体は未確認
- AAMbrowser role/name queryを測定。platform Accessibility API、実際の支援技術の読み上げ、他環境の比較は未実施
- ReviewExpert-gap Reviewは未実施
このTopicは初期Coverageです。選定fixtureとtestの成功は、すべてのHTML構造、browser、OS、支援技術で同じ結果になることを示しません。
関連Surface
列グループの仕様と実測結果はcolgroup Topic、初心者向けの例はYugienのcolgroup要素ページで扱います。
初心者向けの例はYugienのthead要素ページを参照してください。表全体の構造はtable Topic、見出しcellとcell associationはth Topic、表本体の行グループはtbody Topic、summary row groupはtfoot Topic、row structureはtr Topicで扱います。