I want to know how to make material-table column resize in react. Please help me. I've tried the following code
options={{
sorting:false,
resizable:true,
I want to know how to make material-table column resize in react. Please help me. I've tried the following code
options={{
sorting:false,
resizable:true,
Material UI now is not supported but you can put a div on the right edge of the header of each cell to resize its column. Here is my solution Resize columns table Material-ui
There is no resize path in material-ui table. you can use material-ui Data grid -(Demo Link): https://material-ui.com/components/data-grid/demo/#data-grid-demo.
Or
You can rewrite the existing material-ui table style like :
.MuiTableHead-root .MuiTableRow-root .MuiTableCell-head {
font-weight: bold;
resize: horizontal;
overflow-x: overlay;
overflow-y: hidden;
border-right: 1px solid;
}
this feature is included under the paid DATAGRID-PRO
Material UI Data grid column resize is not working.
[
{ field: 'id', header: 'id'},
{ field: 'count', header: 'Count', type: 'number'},
{ field: 'total', header: 'Total', type: 'number'}
];
resize should be true by default
I have found specifying the cell style assists in manipulation of your column sizes
{
field: 'Resizing',
title: 'Column Width',
cellStyle: {
whiteSpace: 'nowrap',
width: '20%',
},
},