I am looking to make the height of the table fit the available space within its parent. Specifically, I would like:
The footer to always be anchored at the bottom of the parent container.
If the table has only a few rows, I want the footer to stay at the bottom.
If the table has more rows than can fit in the parent's height and overflow is necessary, I want the overflow to only show for the body of the table while keeping the footer anchored at the bottom without being pushed down.
To explore using a flexbox approach if feasible (as it seems like a flex scenario).
What I do not want:
An approach based on setting height to 100vh.
Using calc(100vh - ***px) because I prefer a methodology that can be applied across different component hierarchies in my solution.
Setting fixed heights for the table.
Relying on absolute/fixed positioning.
Third-party solutions, if possible.
Using .offsetHeight.
Example: https://stackblitz.com/edit/react-8h5dpy
Visual Examples: