How do I make this react materials ui table have less width <TableContainer…
- User
How do I make this react materials ui table have less width
- Assistant
To adjust the width of your React Material-UI table, you should rather set the desired width directly on the
Tablecomponent or the wrappingTableContainercomponent and let Material-UI handle the layout based on that width constraint. Adjusting margin might not give you the expected result, especially for components designed to be responsive.Instead, you should apply a
widthstyle directly to theTableContainerorTablecomponent. Here is how you do it:jsx<TableContainer component={Paper} style={{ width: '50%' }}> <Table aria-label="Classes"> {/* ... the rest of your table */} </Table> </TableContainer>