HTML rowspan Attribute

The HTML rowspan attribute define the number of rows a cell of a table should span in an HTML document. It can only be applied on td or th HTML element.


Following is the syntax −

<tagname rowspan=”number”></tagname>

Let us see an example of HTML rowspan Attribute −


Live Demo

<!DOCTYPE html>
   body {
      color: #000;
      background: lightblue;
      height: 100vh;
      text-align: center;
   table {
      margin: 2rem auto;
      width: 400px;
<h1>HTML rowspan Attribute Demo</h1>
<table border="2">
<td rowspan="2">Elon</td>


Updated on: 17-Feb-2021

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started