W3Schools.com

HTML <th> rowspan Attribute

HTML th Reference HTML <th> tag

Example

An HTML table with a header cell that spans three rows:

<table width="100%" border="1">
  <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 »
(more examples at the bottom of this page)


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The rowspan attribute is supported in all major browsers.

Note: Only Opera supports rowspan="0", which has a special meaning (look below in the "Attribute Values" table).


Definition and Usage

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


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)


Examples

Try it Yourself - Examples

Use of rowspan="0"
This example will only work in Opera, and it demonstrates rowspan="0".


HTML th Reference HTML <th> tag
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE