HTML Table: An example on using rowspan

This entry is part 9 of 16 in the series HTML Table

Row span allows a row to span over multiple columns.

To implement rowspan:

<td rowspan='2'>

Notice there are only 2 <td> in the last row.

<!DOCTYPE html>
<html>
<head lang='en'>     
    <meta charset='UTF-8'>
    <title>Codecrawl.com-HTML Table</title>
</head>
<body>

<table border='1' width='80%'>
    <tr>
        <th>Country</th>
        <th>Artiste</th>
        <th>Album</th>
    </tr>
    <tr>
        <td rowspan='2'>British</td>
        <td>Rod Stewart</td>
        <td>Maggie May</td>
    </tr>
    <tr>
        <td>Oasis</td>
        <td>Nevermind</td>
    </tr>
</table>

</body>
</html>

We can align the first column using align=’center’.

<td rowspan='2' align='center'>British</td>

Series Navigation<< HTML Table: Spanning or merging table cells
HTML Table: Inserting an image to a row spanning column >>