mui-datatables
mui-datatables copied to clipboard
Add support for dense table
Just as material-ui dense table and bootstrap small table, Kindly support dense option to make tables more compact by cutting cell padding.
This looks like it could be done via a setTableProps option, similar to https://github.com/gregnb/mui-datatables/issues/871, if I have time, I'll see about putting a PR together tomorrow.
Just in case anyone else needs this, the example https://github.com/gregnb/mui-datatables/issues/871 mentioned above uses
...
options: {
setTableProps: () => {
return {
// material ui v4 only
size: 'small',
};
},
...
any updates on this? MUI 5 is out so I take that this isn't compatible anymore?
any updates on this? MUI 5 is out so I take that this isn't compatible anymore?
It just works, all you need is trying ;)
Just in case anyone else needs this, the example #871 mentioned above uses
... options: { setTableProps: () => { return { // material ui v4 only size: 'small', }; }, ...
saved my day, thanks
Thanks @ltalirz. I've updated your fix for MUI v5:
...
options: {
setTableProps: () => {
return {
// material ui v5 only
size: 'small',
};
},
...
hey @alxndrsn , I am trying to use this for setting my table density on click of a free-action. I am just calling the options.setTableProps() method in the click handler of the free action and I added the function to my options object as shown above. But no luck. I have also tried just setting the size option to "small" and I am not seeing a change in my table rows padding. Are there css styles that may conflict with this option setting?