HTML rowspan 属性

前へ 全ての HTML 属性 次へ

定義と用法

rowspan 属性は、結合するセルの行数を指定します。


適用

rowspan 属性は、以下の要素で使用することができます:

要素 属性
<td> rowspan
<th> rowspan

Td の例

2 つの行を結合したテーブルセルを持つ HTML テーブル:

<table>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th>Savings for holiday!</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
    <td rowspan="2">$50</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>
Try it Yourself ❯

Th の例

3 つの行を結合したヘッダセルを持つ HTML テーブル:

<table>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th rowspan="3">Savings for holiday!</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>
Try it Yourself ❯

ブラウザ・サポート

rowspan 属性は、要素ごとに以下のブラウザがサポートしています。

要素
td Yes Yes Yes Yes Yes
th Yes Yes Yes Yes Yes

前へ 全ての HTML 属性 次へ