Hello there,
I've been experimenting with replacing my table layout with divs and CSS, but I'm struggling to find a way to replicate the behavior of the rowspan attribute. Here is the original code snippet:
<table>
<tr>
<td>some content</td>
<td>some more content</td>
<td rowspan="2">THIS is A COLUMN</td>
</tr>
<tr>
<td colspan="2">SINGLE CELL ROW</td>
</tr>
</table>
After attempting to use CSS for the layout:
<header>
<section>
<div>some content</div>
<div>some more content</div>
<div rowspan="2">THIS is A COLUMN</div>
</section>
<section>
<div>SINGLE CELL ROW</div>
</section>
</header>
header {display:table;}
section {display:table-row;}
div {display:table-cell;}
Unfortunately, this approach doesn't work as expected because the bottom div does not extend below the rowspanned div like it should. Is there a CSS solution that can help achieve this layout?
Thanks for your assistance.
Please note that this query is specific to implementing ROWSPAN, not just colspan.