You might also trick the table-layout of the table itself and use a pseudo element.
By default, cells expand to contain their content. Height on a cell will be closer to a min-height than a fixed height. The cell will stretch in height anyway.
If you set every cell to height:0, then add a pseudo-element on the last child within the table-layout, it will stretch to fill the space left.
Below a snippet example to demonstrate the idea:
table {
height: 100vh;
width: 100%;
border: 1px solid;
border-collapse: collapse;
background: yellow;
}
thead,
tfoot {
background-color: #333;
color: #fff
}
tr>* {
height: 0;
border: solid 1px;
}
table::before {
content: " ";/* an empty space is needed for firefox */
display: table-footer-group;
/* works and needed for chrome */
--varHeight: 100%;
height: if(style(--varHeight: 100%): 100%; else: auto);
}
body {
margin: 0;
}
<table>
<thead>
<tr>
<th>th</th>
<th>th</th>
<th>th</th>
<th>th</th>
</tr>
</thead>
<tbody>
<tr>
<td>cell</td>
<td>cell</td>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
<td>cell</td>
<td>cell</td>
</tr>
<tr>
<td>cell</td>
<td>cell</td>
<td>cell</td>
<td>cell</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>footer</td>
<td>footer</td>
<td>footer</td>
<td>footer</td>
</tr>
</tfoot>
</table>
edit
It did not work in chrome browsers and requires for chrome to set ann height to the pseudo.
Unfortunately, the behavior is not consistent from browsers to browsers. I had to include some CSS not yet supported in Firefox.
Finally, i would not recommend to use this since Firefox will support the if() else: CSS rule one day or another.