From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/html/element/caption/index.html | 172 +++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 files/ja/web/html/element/caption/index.html (limited to 'files/ja/web/html/element/caption/index.html') diff --git a/files/ja/web/html/element/caption/index.html b/files/ja/web/html/element/caption/index.html new file mode 100644 index 0000000000..61d20c88ee --- /dev/null +++ b/files/ja/web/html/element/caption/index.html @@ -0,0 +1,172 @@ +--- +title: ': 表キャプション要素' +slug: Web/HTML/Element/caption +tags: + - Element + - HTML + - HTML Tables + - HTML tabular data + - Reference + - Table Captions + - Table Titles + - Tables + - Web + - caption +translation_of: Web/HTML/Element/caption +--- +
{{HTMLRef}}
+ +

HTML の <caption> 要素は、表のキャプション (またはタイトル) を指定します。

+ +
{{EmbedInteractiveExample("pages/tabbed/caption.html", "tabbed-taller")}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
コンテンツカテゴリなし
許可されている内容フローコンテンツ
タグの省略要素の直後に ASCII 空白文字やコメントが続かない場合、終了タグは省略可能です。
許可されている親要素{{HTMLElement("table")}} 要素。table 要素の最初の子要素としてのみ配置可能。
暗黙の ARIA ロール対応するロールなし
許可されている ARIA ロール許可されている role なし
DOM インターフェイス{{domxref("HTMLTableCaptionElement")}}
+ +

属性

+ +

この要素は グローバル属性 を持ちます。

+ +

非推奨の属性

+ +

以下の属性は非推奨であり、使用するべきではありません。以下に記述しているのは、既存コードを更新する際の参考や、歴史的な関心としてのためのみです。

+ +
+
{{htmlattrdef("align")}} {{deprecated_inline}}
+
この列挙属性は caption 要素の、自身の指し示す table 要素を基準とした相対的な位置を指定します。以下の値を指定できます。 +
+
left
+
キャプションを表の左側に表示します。
+
top
+
キャプションを表の上側に表示します。
+
right
+
キャプションを表の右側に表示します。
+
bottom
+
キャプションを表の下側に表示します。
+
+ +
使用上の注意: この属性は非推奨ですので使用しないでください。 {{HTMLElement("caption")}} 要素にスタイルを適用するには、 CSS プロパティの {{cssxref("caption-side")}} および {{cssxref("text-align")}} を使用してください。
+
+
+ +

使用上の注意

+ +

<caption> 要素は親である {{htmlelement("table")}} 要素の最初の子としてください。

+ +

<table> 要素が {{HTMLElement("figure")}} 要素の唯一の子孫である場合は、 {{HTMLElement("figcaption")}} 要素を <caption> の代わりに使用してください。

+ +

+ +

このシンプルな例は、キャプションを含む票を表します。

+ +
<table>
+  <caption>Example Caption</caption>
+  <tr>
+    <th>Login</th>
+    <th>Email</th>
+  </tr>
+  <tr>
+    <td>user1</td>
+    <td>user1@sample.com</td>
+  </tr>
+  <tr>
+    <td>user2</td>
+    <td>user2@sample.com</td>
+  </tr>
+</table>
+ + + +

{{EmbedLiveSample('Example', 650, 100)}}

+ +

table {background: red;} ではキャプションは変更されません。そのためには display: block が必要です。

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', 'tables.html#the-caption-element', '<caption>')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'tabular-data.html#the-caption-element', '<caption>')}}{{Spec2('HTML5 W3C')}}
{{SpecName('HTML4.01', 'struct/tables.html#h-11.2.2', '<caption>')}}{{Spec2('HTML4.01')}}
+ +

ブラウザーの互換性

+ + + +

{{Compat("html.elements.caption")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf