Is it possible to set the width of Table columns?
+1
Nothing quite special about this :
const colWidth {
width: '2rem'
};
<TableRowColumn style={ colWidth }>
...
</TableRowColumn>
<TableRowColumn style={{ width: 100 }}>
doesn't behave too well with TableHeaderColumn
Is there any way to dynamically assign the width of col based on content ?
In my vanilla HTML table, the columns width are automatically set depending on content. material-ui seems to enforce equal width on all columns. Is there a way to set width of column to be dynamic instead, like vanilla HTML tables?
@sanfilippopablo, <Table>
uses the table-layout: 'fixed'
css prop, leading to all columns having the same width, combined with white-space: 'nowrap'
on every table cell to handle the overflow.
You can't safely switch to table-layout: 'auto'
since the table then grows infinitely with its content unless you remove the above-mentioned white-space css prop. And if you do this,
you can't use the fixedHeader={true}
prop anymore since headers are then contained in a separate table :cry:.
Some feedback would be appreciated.
What I've been doing to set the widths of columns is for the
Most helpful comment
In my vanilla HTML table, the columns width are automatically set depending on content. material-ui seems to enforce equal width on all columns. Is there a way to set width of column to be dynamic instead, like vanilla HTML tables?