You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am a new user of this component and am trying to figure out how to get columns to size nicely. In my old homebrew HTML tables, columns would automatically size to the contents, but after moving to material-table each column seems to get the same width, making some columns wrap and take up more than one line way too soon.
I see that for each column I define I can set a width property, but I do not see an example for how to use this property and would rather not hard-code numbers of pixels if I can help it.
I would like some columns (including Actions) to auto-size to their contents and never wrap while others grow with the table width.
My biggest problem right now is that when I switch from material-table to @material-table/core the Actions column (which has Edit and Delete icons in it because I specified onRowUpdate and onRowDelete, not because I added actions) quickly wraps to put these two icons one under the other, making all rows two rows high, unless the window is extremely wide.
I tried setting tableLayout: auto, but that seems to be the default and setting it has no effect.
Thank you all for working on this wonderful component.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am a new user of this component and am trying to figure out how to get columns to size nicely. In my old homebrew HTML tables, columns would automatically size to the contents, but after moving to material-table each column seems to get the same width, making some columns wrap and take up more than one line way too soon.
I see that for each column I define I can set a width property, but I do not see an example for how to use this property and would rather not hard-code numbers of pixels if I can help it.
I would like some columns (including Actions) to auto-size to their contents and never wrap while others grow with the table width.
My biggest problem right now is that when I switch from material-table to @material-table/core the Actions column (which has Edit and Delete icons in it because I specified onRowUpdate and onRowDelete, not because I added actions) quickly wraps to put these two icons one under the other, making all rows two rows high, unless the window is extremely wide.
I tried setting tableLayout: auto, but that seems to be the default and setting it has no effect.
Thank you all for working on this wonderful component.
Beta Was this translation helpful? Give feedback.
All reactions