Html-table-tag
提供:Dev Guides
HTML-<table>タグ
説明
HTMLの<table>タグは、テーブルの定義に使用されます。 テーブルタグには、テーブルの構造を定義する他のタグが含まれます。
例
<!DOCTYPE html>
<html>
<head>
<title>HTML table Tag</title>
</head>
<body>
<table border = "1">
<tr>
<th>Team</th>
<th>Ranking</th>
</tr>
<tr>
<td>India</td>
<td>1</td>
</tr>
<tr>
<td>South Africa</td>
<td>2</td>
</tr>
<tr>
<td>Australia</td>
<td>3</td>
</tr>
</table>
</body>
</html>
これは、次の結果を生成します-
グローバル属性
このタグは、− link:/html/html_attributes_reference [HTML属性リファレンス]で説明されているすべてのグローバル属性をサポートします
特定の属性
HTML <table>タグは、次の追加属性もサポートしています-
Attribute | Value | Description |
---|---|---|
abbr | abbreviated_text | Deprecated − Specifies an abbreviated version of the content in a cell. |
align | right left center justify char | Deprecated − Visual alignment. |
bgcolor | rgb(x,x,x) #hexcode colorname | Deprecated − Specifies the background color of the table. |
border | pixels | Deprecated − Specifies the border width. A value of "0" means no border. |
cellpadding | pixels or % | Deprecated − Specifies the space between the cell borders and their contents. |
cellspacing | pixels or % | Deprecated − Specifies the space between cells. |
frame | void above below hsides lhs rhs vsides box border | Deprecated − Used in conjunction with the border attribute, specifies which side of the frame that makes up the border surrounding the table is displayed. |
rules | none groups rows cols all | Deprecated − Used in conjunction with the border attribute, specifies which rules appear between the cells of the table. |
summary | text | Deprecated − Specifies the summary of the content. |
width | pixels or % | Deprecated − Specifies the width of the table. |
イベント属性
このタグは、− link:/html/html_events_reference [HTMLイベントリファレンス]で説明されているすべてのイベント属性をサポートします。
ブラウザのサポート
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |