I have a table with multiple cells, don't have any information about the height of the cells but I want the height of the content of one of the cells (which is a flexbox container) to take 100% of the cell's height:
<table border="1">
<tr>
<td>
<div style="height: 152px">some content</div>
</td>
<td style="vertical-align: top">
<div style="display: flex; flex-wrap: wrap;">
<div style="height: 100%; min-height: 100%; flex: 1; background: red">
This should take 100% height
</div>
</div>
</td>
</tr>
</table>
<td>, there is a reason for setting the red-background on the <div> for the example.You may set the td height to 0 and then the outer div's height to 100%. Check the following code:
<table border="1">
<tr>
<td style="height: 0">
<div style="height: 100%">some content</div>
</td>
<td style="vertical-align: top; height: 0;">
<div style="display: flex; flex-wrap: wrap;">
<div style="height: 100%; min-height: 100%; flex: 1; background: red">
This should take 100% height
</div>
</div>
</td>
</tr>
</table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With