Horje

How to add HTML <th> rowspan Attribute

It is An HTML table with a header cell that spans three rows.

Definition and Usage

The rowspan attribute defines the number of rows a header cell should span.


Browser Support

Syntax

<th rowspan="number">

Attribute Values

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)

 

index.html
Example: 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> 

Output should be:

How to add HTML <th> rowspan Attribute




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin