Html-thead-tag
提供:Dev Guides
HTML-<thead>タグ
説明
HTML <thead>タグは、テーブルにヘッダーを追加する際に使用されます。 theadタグは、テーブルの各部分(ヘッダー、フッター、ボディ)を決定する際に、tbodyタグおよびtfootタグと組み合わせて使用されます。
例
<!DOCTYPE html>
<html>
<head>
<title>HTML thead Tag</title>
</head>
<body>
<table style = "width:100%" border = "1">
<thead>
<tr>
<td colspan = "4">This is the head of the table</td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan = "4">This is the foot of the table</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
</table>
</body>
</html>
これは、次の結果を生成します-
グローバル属性
このタグは、− link:/html/html_attributes_reference [HTML属性リファレンス]で説明されているすべてのグローバル属性をサポートします
特定の属性
HTML <thead>タグは、次の追加属性もサポートしています-
Attribute | Value | Description |
---|---|---|
align | right left center justify char | Deprecated − Visual alignment. |
char | character | Deprecated − Specifies which character to align text on. Used when align = "char" |
charoff | pixels or % | Deprecated − Specifies an alignment offset (either in pixels or percentage value) against the first character as specified with the char attribute. Used when align = "char" |
valign | top middle bottom baseline | Deprecated − Vertical alignment. |
イベント属性
このタグは、− link:/html/html_events_reference [HTMLイベントリファレンス]で説明されているすべてのイベント属性をサポートします。
ブラウザのサポート
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |