Spanning cells are created by inserting the rowspan and colspan attributes in a <td> or <th> tags. The syntax for these attributes is:
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.
Layout | HTML tags | |||
---|---|---|---|---|
|
<table border="1"> <tr><td rowspan="2">cell 1</td> <td>cell 2</td></tr> <tr><td>cell 3</td></tr> </table> |
Layout | HTML tags | ||||
---|---|---|---|---|---|
|
<table border="1"> <tr><td>cell 1</td> <td>cell 2</td></tr> <tr><td colspan="2">cell 3</td ></tr> </table> |