Spanning rows and columns

Spanning cells are created by inserting the rowspan and colspan attributes in a <td> or <th> tags. The syntax for these attributes is:

rowspan="value" colspan="value"

where value is the number of rows or columns that the cell spans in the table. The two following examples demonstrate the usage of these attributes.

LayoutHTML tags
cell 1cell 2
cell 3
<table border="1">
<tr><td rowspan="2">cell 1</td> <td>cell 2</td></tr>
<tr><td>cell 3</td></tr>
</table>


LayoutHTML tags
cell 1cell 2
cell 3
<table border="1">
<tr><td>cell 1</td> <td>cell 2</td></tr>
<tr><td colspan="2">cell 3</td ></tr>
</table>