Updates
  • Starting New Weekday Batch for Full Stack Java Development on 15 September 2025 @ 02:00 PM to 04:00 PM
  • Starting New Weekday Batch for MERN Stack Development on 29 September 2025 @ 04:00 PM to 06:00 PM
Join Course

Colspan and Rowspan

• In HTML tables, colspan and rowspan are attributes used to span multiple columns or rows within a table.
• The colspan attribute is used to specify how many columns a cell should span horizontally.
• The rowspan attribute is used to specify how many rows a cell should span vertically.
• By using colspan or rowspan, you can merge adjacent cells to create more complex table layouts.
• To apply these attributes, add them to the <td> or <th> tags and specify the desired number of columns or rows to span.

            
<!DOCTYPE html>
<html>
<head>
    <title>rowspan and colspan</title>
    <style>
        table, th, td {
        width:200px;
        border: 3px;
        border-style: solid;
        border-collapse: collapse;
        }
        </style>
</head>
<body>
    <h1>Table rowspan and colspan</h1>
    <table>
        <tr>
            <th>Name</th>
            <td colspan="2">Som prakash rai</td>
        </tr>
        <tr>
            <th rowspan="2">Mobile No.</th>
            <td>9990399111</td>
 	    <td>9990699111</td>
        </tr>
	<tr>
	    <td>9988776655</td>
	</tr>
    </table>
</body>
</html>