Table part 3

Colspan Color



The example below demonstrates the colspanattribute in action:
<table border="2">
<tr>
<td>Red</td>
<td>Blue</td>
<td>Green</td>
</tr>
<tr>
<td>Yellow</td>
<td colspan="2">Orange</td>
</tr>
</table>
Try It Yourself

Result:
You can see that the cell containing "Orange" spans two cells.
To make a cell span more than one row, use the rowspan attribute.

Comments