Qbert Qbert - 4 years ago 104
CSS Question

Place two cells under a header with the colspan of 1

I am struggling to put the cells containing { Lazy, Dog, Then, It } under the same header (with a colspan of 1)

I've tried creating div tags within my cell, creating 2 cells, and all the possible widths and colspan combinations I can think of.

enter image description here

Using div tags and CSS I can get Lazy and Dog under the header, but they are not individual cells.

enter image description here


border: 1px solid black;

.lazy {
float: left;
width: 50%;

.dog {
float: right;
width: 50%;
<th>brown fox</th>


<td rowspan=3>over the</td>
<td><div class="lazy">lazy</div> <div class="dog">dog</div></td>


<td colspan=2> prey to a lion </td>


Thank you for any advice.

Answer Source

add colspan="2" to <th>brown fox</th>

you don't have to put div inside <td> to separate data

then edit your <td colspan=2> prey to a lion </td>

to <td colspan="3"> prey to a lion </td>

here is the working fiddle, hope it helped you


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download