Атрибут HTML <th> rowspan

❮ HTML-тег <th>

Пример

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>

Другие примеры «Попробуйте сами» ниже.


Определение и использование

Атрибут rowspanопределяет количество строк, которые должна охватывать ячейка заголовка.


Поддержка браузера

Attribute
rowspan Yes Yes Yes Yes Yes


Синтаксис

<th rowspan="number">

Значения атрибутов

Value Description
number Sets the number of rows a header 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)

Дополнительные примеры

Пример

Используя rowspan="0" (работает в Chrome, Firefox и Opera):

<table>
<thead>
  <tr>
    <th>Month</th>
    <th>Savings</th>
    <th rowspan="3">Savings for holiday!</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td>January</td>
    <td>$100</td>
    <td rowspan="0">$100</td>
  </tr>
  <tr>
    <td>February</td>
    <td>$80</td>
  </tr>
</tbody>
</table>

❮ HTML-тег <th>