Smart Communication Design Company
ホーム > ナレッジ > 用語集 > Web制作用語集 > HTML用語集 > th要素

th要素

th要素は、直近の祖先であるtable要素における見出しのセルを表します。

<tr>
<th>見出し</th>
<td>値</td>
<td>値</td>
<tr>

使用例

<table id="glossary-html-element-colgroup">
<caption>カテゴリ別好きな食べ物ベスト3</caption>

<colgroup span="1">
<colgroup span="3">
<colgroup span="3">

<thead>
<tr>
<td rowspan="2"></td>
<th scope="rowgroup" colspan="3" id="th-sushi">お寿司</th>
<th scope="rowgroup" colspan="3" id="th-yakitori">焼き鳥</th>
</tr>
<tr>
<th scope="row" headers="th-sushi" id="th-s-1">1位</th>
<th scope="row" headers="th-sushi" id="th-s-2">2位</th>
<th scope="row" headers="th-sushi" id="th-s-3">3位</th>
<th scope="row" headers="th-yakitori" id="th-y-1">1位</th>
<th scope="row" headers="th-yakitori" id="th-y-2">2位</th>
<th scope="row" headers="th-yakitori" id="th-y-3">3位</th>
</tr>
</thead>

<tbody>
<tr>
<th scope="col" id="th-row">Aさん</th>
<td headers="th-row th-sushi th-s-1">かんぱち</td>
<td headers="th-row th-sushi th-s-2">ばい貝</td>
<td headers="th-row th-sushi th-s-3">つぶ貝</td>
<td headers="th-row th-yakitori th-y-1">砂肝(塩)</td>
<td headers="th-row th-yakitori th-y-2">ねぎま(塩)</td>
<td headers="th-row th-yakitori th-y-3">皮(塩)</td>
</tr>

<tr>
<th scope="col" id="th-row-2">Bさん</th>
<td headers="th-row-2 th-sushi th-s-1">大トロ</td>
<td headers="th-row-2 th-sushi th-s-2">うに</td>
<td headers="th-row-2 th-sushi th-s-3">いくら</td>
<td headers="th-row-2 th-yakitori th-y-1">レバー</td>
<td headers="th-row-2 th-yakitori th-y-2">ハツ(タレ)</td>
<td headers="th-row-2 th-yakitori th-y-3">とりもも(タレ)</td>
</tr>
</tbody>
</table>

使用可能な属性

コンテンツカテゴリ

子要素にしていい要素の種類

親要素にしていい要素の種類

仕様書と策定状況

仕様書 策定状況
W3C 勧告
WHATWG Living Standard
最終更新:2017年6月26日