HTML <caption> align 属
例
下部に揃えられた <caption> 要素を持つテーブル:
<table border="1">
<caption align="bottom">My savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<caption align="bottom">My savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
試してみる »
ブラウザサポート
![]()
すべての主要ブラウザが align 属性をサポートしています。
注意:
- Internet Explorer 8 は "left", "right", "top", "bottom" の値をサポートします。
- Internet Explorer 9 以降は "top" と "bottom" の値をサポートします。
- Firefox は "left", "right", "top", "bottom" の値をサポートします。
- Opera は "left", "right", "top", "bottom" の値をサポートします。
- Chrome は "top" と "bottom" の値をサポートします。
- Safari は "top" と "bottom" の値をサポートします。
定義と使い方
HTML5 は <caption> の align 属性をサポートしていません。代わりに CSS を使用してください。
<caption> の align 属性は HTML 4.01 では非推奨です。
align 属性は caption 要素の配置方法を指定します。
この属性は、caption をブロック要素として、テーブルの左辺、右辺、上辺、下辺に配置します。
互換性に関する注記
HTML5 は <caption> の align 属性をサポートしていません。代わりに CSS を使用してください。
CSS 構文: <caption style="caption-side:bottom"> または <caption style="text-align:left">
CSS チュートリアルでは、次の詳細を見つけることができます。caption-side属性の詳細。
構文
<caption align="left|right|top|bottom">
属性値
| 值 | 説明 |
|---|---|
| left | キャプションはテーブルの左側に配置されます。 |
| right | キャプションはテーブルの右側に配置されます。 |
| top | キャプションはテーブルの上側に配置されます。 |
| bottom | キャプションはテーブルの下側に配置されます。 |
その他の拡張
HTML <caption> タグ