HTML <th> rowspan eigenschap

Definitie en gebruik

rowspan De eigenschap definieert het aantal rijen dat de titelcel moet overschrijden.

Voorbeeld

Voorbeeld 1

HTML tabel met een titelcel die over drie rijen strekt:

<table>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th rowspan="3">Holiday savings!</th>
  </tr>
  <tr>
    <td>January</td>
    <td>¥3000</td>
  </tr>
  <tr>
    <td>February</td>
    <td>¥4000</td>
  </tr>
</table>

Try it yourself

Example 2

Example 2 using rowspan="0" (for Chrome, Firefox, and Opera):

<table>
</thead>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th rowspan="3">Holiday savings!</th>
  </tr>
</thead>
</tbody>
  <tr>
    <td>January</td>
    <td>¥3000</td>
    <td rowspan="0">¥3500</td>
  </tr>
  <tr>
    <td>February</td>
    <td>¥4000</td>
  </tr>
</tbody>
</table>

Try it yourself

syntax

<th rowspan="number">

attribute value

value description
number

Set the number of rows the title cell should span.

Note:rowspan="0" tells the browser to span the cell to the last row of the table section (thead, tbody, or tfoot).

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support