I have two table cells in one row. First one has small div, second one has larger one. Second div stretches the whole row. How do I make the first div stretch to the whole cell as well?
This is what I get:
This is what I want:
HTML:
<table>
<tr class="tr">
<th class="th">
<div class="div green">This div is short</div>
</th>
<th class="th">
<div class="div blue">This div has more content so it pushes
the height of the whole row. However, the shorter div doesn't
stretch to the whole row. How do I fix this?</div>
</th>
</tr>
</table>
CSS:
.tr {
width:100%;
border:1px solid red;
height:auto;
}
.th {
display:table-cell;
width:50%;
}
.div {
/* What should be here? */
}
.green {
background:green
}
.blue {
background:blue
}
Why I need this: the table stores lots of tabular data. Table headers contain widgets for filtering out table contents, and these widgets have variable height.