rowspan Attribute


 

Where to use the rowspan Attribute

  • As Type Number - default="1":
    rowspan is declared on the elements: th, td

Description

The rowspan attribute is used on a table cell (td or th) to specify the number of rows to be spanned by the cell.

For example:

<table border="1"><tbody>
<tr><td rowspan="3">This cell spans three table rows</td> <td>but</td></tr>
<tr><td>each</td></tr>
<tr><td>other cell</td></tr>
<tr><td>spans</td> <td>only one</td></tr>
</tbody></table>

This renders as:

This cell spans three table rows but
each
other cell
spans only one

The default value is "1" and the special value of "0" indicates that the cell should span all remaining rows, from the current row to the last row in the current table section (either thead, tbody or tfoot). If none these three table section elements are present, the cell should span to the last row of the table itself.

Note: the special case of rowspan="0" is not very well supported across user agents.

Although not stated officially (not that I can find, anyway) any cell which spans multiple rows should not cross a boundary between thead, tfoot or tbody elements.

See also the colspan attribute.


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 16 May 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Attribute Index (XHTML 1.1) > rowspan Attribute (XHTML 1.1)