I have a table where cells have a fixed height. In one of the cells there is a tall element that makes one row expand vertically. And there is another cell with a div element that is set to 100% the height of the cell. I would like to make this div element expand vertically to the cell height, further than the original set height of the cell. How can I do this?
table,
th,
td {
border: 4px solid black;
border-collapse: collapse;
}
th,
td {
background-color: orange;
height: 30px;
padding: 0px;
}
<table>
<tr>
<td>
<div style="height:50px; background:green">Tall element</div>
</td>
<td>
<div style="background:yellow;height:100%">Should expand</div>
</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>