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

[Table] minimum width for "TableRowColumn"

Open francescabarbazeni87 opened this issue 10 years ago • 4 comments

Description

It could be usefull to set the minimum width for a table row column. In this way when we have a large number of columns the table could automatically show the horizontal overflow.

francescabarbazeni87 avatar May 12 '16 13:05 francescabarbazeni87

@francescabarbazeni87 could you figure out any solution around that?

eduedix avatar Jun 14 '16 13:06 eduedix

You could work around it using custom styles:

//...
const styles = {
    longCell: {
        minWidth: '1000px',
    },
    tableWrapper: {
        overflowX: 'auto',
    },
};

const LongTable = ({classes}) => (
    <div className={classes.tableWrapper}>
        <Table>
            <TableHead>
                <TableRow>
                    <TableCell>ID</TableCell>
                    <TableCell className={classes.longCell}>Long Cell</TableCell>
                </TableRow>
            </TableHead>
        </Table>
    </div>
);
//...

AndriusBil avatar Sep 18 '17 12:09 AndriusBil

Why not TableCell can not add xs like Grid ??

eromoe avatar Sep 29 '17 07:09 eromoe

@AndriusBil Thanks for sharing a solution.

oliviertassinari avatar Oct 31 '19 16:10 oliviertassinari