Web4College

HTML rowspan attribute

rowspan attribute allows a cell to span more than one rows. It merges two cells to span two rows.

Example
Try it
<table border="2">
 <tr>
  <th rowspan="2">Name</th>
  <th>way1</th>
  <th>way2</th>
 </tr>
 <tr>
  <th>Email</th>
  <th>Tel</th>
 </tr>
 <tr>
  <td>Carl</td>
  <td>carl@example.com</td>
  <td>1234555</td>
 </tr>
 <tr>
  <td>Chad</td>
  <td>chad@example.com</td>
  <td>4552211</td>
 </tr>
 <tr>
  <td>Adler</td>
  <td>adler@example.com</td>
  <td>2555245</td>
 </tr>
</table>
Nameway1way2
EmailTel
Carlcarl@example.com1234555
Chadchad@example.com4552211
Adleradler@example.com2555245

Attribute values

All possible values of rowspan attribute

The value of this attribute is a valid positive integer. The integer is the number of rows spanned by the cell.

The following example uses both rowspan and colspan attributes.

Preview Example
Try it

colspan attribute allows a cell to span two columns. rowspan attribute allows a cell to span two rows.

Related Tags

The tags that support rowspan attribute

<th> tag

<th> tag defines a data cell for the heading section in a table. It supports rowspan attribute.

<td> tag

<td> defines a data cell for the body section in a table.

The zero value indicates that the cell is to span all the remaining rows.