--- title: caption-side slug: Web/CSS/caption-side tags: - CSS - CSS Property - CSS Tables - Reference translation_of: Web/CSS/caption-side ---
caption-side は、表 ({{htmlelement("table")}}) の {{HTMLElement("caption")}} の配置位置を指定する CSS プロパティです。
{{cssinfo}}
/* 方向を示す値 */ caption-side: top; caption-side: bottom; /* 警告: 非標準の値 */ caption-side: left; caption-side: right; caption-side: top-outside; caption-side: bottom-outside; /* グローバル値 */ caption-side: inherit; caption-side: initial; caption-side: unset;
このプロパティの値は、表の {{cssxref('writing-mode')}} に対して相対的です。
topbottomleft {{non-standard_inline}}right {{non-standard_inline}}top-outside {{non-standard_inline}}top について異なる動作を説明していたとの注記があります。この動作は将来の仕様書で、この値を使用して再導入する予定です。")}}bottom-outside {{non-standard_inline}}bottom について異なる動作を説明していたとの注記があります。この動作は将来の仕様書で、この値を使用して再導入する予定です。")}}<table class="top">
<caption>Caption ABOVE the table</caption>
<tr>
<td>Some data</td>
<td>Some more data</td>
</tr>
</table>
<br>
<table class="bottom">
<caption>Caption BELOW the table</caption>
<tr>
<td>Some data</td>
<td>Some more data</td>
</tr>
</table>
.top caption {
caption-side: top;
}
.bottom caption {
caption-side: bottom;
}
table {
border: 1px solid red;
}
td {
border: 1px solid blue;
}
{{EmbedLiveSample('Examples')}}
| 仕様書 | 策定状況 | コメント |
|---|---|---|
| {{SpecName('CSS Logical Properties', '#caption-side', 'caption-side')}} | {{Spec2('CSS Logical Properties')}} | 値 top および bottom は、writing-mode の値に対して相対的であることを定義 |
| {{SpecName('CSS2.1', 'tables.html#caption-position', 'caption-side')}} | {{Spec2('CSS2.1')}} | 最初の定義 |
{{Compat("css.properties.caption-side")}}