HTML rowspan attribute

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

<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>[email protected]</td>
  <td>1234555</td>
 </tr>
 <tr>
  <td>Chad</td>
  <td>[email protected]</td>
  <td>4552211</td>
 </tr>
 <tr>
  <td>Adler</td>
  <td>[email protected]</td>
  <td>2555245</td>
 </tr>
</table>
</>
Name way1 way2
Email Tel
Carl [email protected] 1234555
Chad [email protected] 4552211
Adler [email protected] 2555245

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.

Example

Name Contacts
Email Tel
Carl [email protected] 1234555
Chad [email protected] 4552211
Adler [email protected] 2555245
Try </>

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.



Was this article helpful?