My code:
<table style="width: 500px;">
<tr>
<td colspan="5">
<div style="width: 500px;">colspan_5</div>
</td>
</tr>
<tr>
<td colspan="1">
<div style="width: 100px;">colspan_1</div>
</td>
<td colspan="3">
<div style="width: 300px;">colspan_3</div>
</td>
<td colspan="1">
<div style="width: 100px;">colspan_1</div>
</td>
</tr>
<tr>
<td colspan="2">
<div style="width: 200px;">colspan_2</div>
</td>
<td colspan="3">
<div style="width: 300px;">colspan_3</div>
</td>
</tr>
<tr>
<td colspan="5">
<div style="width: 500px;">colspan_5</div>
</td>
</tr>
</table>
But result looks wrong. (jsFiddle_example)
How can I fix it?
The code looks wrong too. Your highest
colspansetting is5, but the mostTDsin a row is three. Why is that?Why not something like this: