caption

書式

<caption>〜</caption>

属性

属性名 初期値 内 容
id なし IDを指定します。
class なし スタイルシートクラスを指定します。
style なし スタイルシートを指定します。
bgcolor なし 背景色を指定します。
align なし 表示位置を指定します。

対応

HTML 3.2, HTML 4.01 [STF], XHTML 1.0 [STF], XHTML 1.1, XHTML Basic
Microsoft (MSDN)
[IE3〜][Firefox 1〜][Safari 1〜][Opera 3〜][Netscape 2〜]

説明

テーブル(表)のキャプションを指定します。

関連タグ

table

サンプルコード [実行]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=shift_jis">
<title>Sample</title>
</head>
<body>
<h1>Sample</h1>
<table border="1">
<caption>りんご注文数</caption>
<tr><th>品種</th><th>個数</th></tr>
<tr><td>つがる</td><td>2</td></tr>
<tr><td>ふじ</td><td>10</td></tr>
</table>
</body>
</html>