material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Table Supports Density and Can Be Made "Dense"

Open brianpdev opened this issue 7 years ago • 12 comments

The table supports MaterialUI Density so that it is easy to specify that the table is "Dense". Less white space in the table, preferred for desktop usage.

brianpdev avatar Mar 07 '19 15:03 brianpdev

Hi @brianpdev ,

I tried something about this. But we use buttons, checkboxes and so. So it could broke some design if we apply this. So won't apply dense. Sorry

mbrn avatar Mar 09 '19 08:03 mbrn

Hey @mbrn, I understand that certain components can break on dense. But can you still please support such that dense can be applied if we do not use checkboxes and buttons in the table?

stemarf50 avatar Apr 09 '19 07:04 stemarf50

of course. I will try to do it.

mbrn avatar Apr 09 '19 19:04 mbrn

Thank you very much. I've chosen to use this for my project and this option will really help :)

stemarf50 avatar Apr 10 '19 04:04 stemarf50

Hey @mbrn, any update on this one?

stemarf50 avatar Apr 19 '19 03:04 stemarf50

@stemarf50 unfortunately. I am working on new documentation nowadays.

mbrn avatar Apr 19 '19 07:04 mbrn

I was also looking forward for this feature. I propose a VERY UGLY workaround, but probably better than nothing. Note that this will not interfere with other pages, so it is better than importing a *.css file, as this would stay in DOM until you reload the page. It could probably be made even better by adding a custom class to make only certain tables in the same page dense. (Adjust padding value to your liking)

const specialCSS = "<style>.MuiTableCell-root.MuiTableCell-body.MuiTableCell-alignLeft { padding: 0 !important } .MuiTableCell-root.MuiTableCell-body.MuiTableCell-paddingNone .MuiIconButton-root { padding: 0 !important }</style>"
<div dangerouslySetInnerHTML={{__html: specialCSS}}></div>

Result:

image

masbaehr avatar Jun 18 '19 19:06 masbaehr

Also look forward to seeing it working.

OnkelTem avatar Nov 11 '19 07:11 OnkelTem

+1

flavioribeiro avatar Mar 02 '20 05:03 flavioribeiro

+1

atinyakov avatar Apr 02 '20 11:04 atinyakov

I have stumbled upon the same issue today... i 've solved it somehow, not 100% "the material way", but it served my purpose... adding to the MaterialTable component the following options:

            options={{
                cellStyle: { padding: '0.3em'},
                headerStyle: { padding: '0.3em'},
              }}

gabizz avatar Apr 06 '20 21:04 gabizz

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

stale[bot] avatar Jul 05 '20 22:07 stale[bot]