I'm using flex: 1
to try to get the last item in my flexbox to fill the remaining height of the parent. It works on all the divs right up until we get to the table element, which just massively overflows once it gets a lot of content in it. How can I tell the table to fit the height of its container?
.fit-to-screen {
display: flex;
flex-direction: column;
height: calc(100vh - 98px);
.fit-to-screen-padding {
padding: 4%;
height: 100%;
display: flex;
flex: 1;
flex-direction: column;
.table-container {
flex: 1;
height: 100%;
.table {
display: flex;
flex: 1;
height: 100%;
flex-direction: column;
border: 1px solid;
width: 100%;
min-width: 445px;
max-width: 1459px;
}
}
}
<div class="fit-to-screen">
<div class="fit-to-screen-padding">
<div class="item-1"></div>
<div class="item-2"></div>
<div class="table-container">
<div class="table"></div>
</div>
</div>
</div>