Can anyone show me how to make a MudTable that has FixedHeader=true but that also expands to fit 100% of the vertical height of the parent container?
If I set the height property to a pixel height (e.g., Height=300px) on the MudTable element, then the fixed header works and the table content scrolls. But if the parent container/dialog/page is bigger than 300px, then the table doesn't expand to fit the space provided.
But if I set the height to 100%, either:
- The
MudTableexpands to fit the number of items in the table, and overflows the bottom of the parent element - Or the fixed header doesn't work, and the entire table scrolls within the parent element, meaning the header doesn't remain fixed at the top of the table.
If it helps, my table is within a FlexBox, with 3 sections:
- A header section, which should be static at the top of the page/dialog/container
- A button bar, which should be at the bottom of the page/dialog/container
- A
MudTable, which should expand to fill the remaining space on the page, and which should have a fixed header, with the content scrolling within the grid if there are more items than will fit.
I've been trying to find a solution to this for literally years, across multiple projects, and never managed it. Is this even possible? If so, can somebody point me at an example that shows the exact combination of CSS that'll do it?
Here's a small repro of what I'm trying to achieve - the 'Save' and 'Close' buttons should be at the bottom of the page, the title at the top, and the table should fill the space in the centre, but have a fixed header.
https://try.mudblazor.com/snippet/wkQplEEQfkzvCAoi
Note that if you change the MudTable height from 300px to 100%, instead of filling the space provided, it expands to go off the bottom of the page, meaning the Save and Close buttons are no longer on screen - and the fixed header no longer works.
heightof its parent, with a header staying at the top of that parent? If so, check if this codepen helps you.heightof the header and footer.