mui-datatable

How to set height to mui-datatables with responsive="scroll"


I need to have fixed table body height to firstly show up on my whole page nicely and secondly to not change height when I choose filters and filter tags are added to header.

I have real trouble finding solution. My best guess I should overwrite MUIDataTable.responsiveScroll class but it does nothing when I change minHeight:'80vh' for exmple.


Solution

  • Yes, you need to override the MUIDataTable.responsiveScroll. This is what I did for expanding to full size of page

    createMuiTheme({
        overrides: {
          MUIDataTable: {
            responsiveScroll: {
              maxHeight: 'none',
            },
          },
        },
      });
    

    You can add other styles there if you want a minimum height.