HTMLの基本
HTMLファイルの基本
文書情報
文字に関する設定
レイアウト
リンク
リストを作る
BACK→>>表を作る 2 表の大きさを設定する。
NEXT→>>表を作る 4 セルの大きさを設定。

<caption>〜</caption>
<caption align="表示位置">〜</caption>
表示位置‥‥‥top又はbottom

要素名属性名説明非推奨必須属性
caption表のタイトル
align表示位置非推奨
classクラス名
idID名
title補足情報
styleスタイルシート
lang言語コード
dir文字表記の方向
表にタイトルを設定するにはcaption要素を使用します。caption要素は、必ずtable要素の開始タグ<table>の直後に 配置してください。表示位置はalign属性を使って、表の上(top)又は表の下(bottom)が指定出来ます。指定しない場合は、表の上に表示されます。
ただし、align属性はHTML4.01では非推奨です。表示位置を指定するときは、スタイルシートを利用してください。
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>表のタイトルを設定する。</title>
</head>
<body>
<table border="2">
<caption>表のタイトルを設定する</caption>
<tr><th>見出し1</th><th>見出し2</th><th>見出し3</th></tr>
<tr><td>データ1</td><td>データ2</td><td>データ3</td></tr>
<tr><td>データ4</td><td>データ5</td><td>データ6</td></tr>
<tr><td>データ7</td><td>データ8</td><td>データ9</td></tr>
</table>
<table border="2">
<caption align="top">表のタイトルを設定する</caption>
<tr><th>見出し1</th><th>見出し2</th><th>見出し3</th></tr>
<tr><td>データ1</td><td>データ2</td><td>データ3</td></tr>
<tr><td>データ4</td><td>データ5</td><td>データ6</td></tr>
<tr><td>データ7</td><td>データ8</td><td>データ9</td></tr>
</table>
<table border="2">
<caption align="bottom">表のタイトルを設定する</caption>
<tr><th>見出し1</th><th>見出し2</th><th>見出し3</th></tr>
<tr><td>データ1</td><td>データ2</td><td>データ3</td></tr>
<tr><td>データ4</td><td>データ5</td><td>データ6</td></tr>
<tr><td>データ7</td><td>データ8</td><td>データ9</td></tr>
</table>
</body>
</html>

Internet Explorer8での表示例

表のタイトルを設定する
表を作る
簡単相互リンクツールtoo-search

相互リンク募集や、お友達のページ紹介、自分のお気に入りサイトを登録できる無料の検索エンジンツール。

登録を募集すれば色んなサイトとのつながりもでき、アクセスアップにも効果抜群。

今すぐ登録!