And for every column add this with the percentage and min width you need mat column colum name flex.
Mat table column width auto adjust.
Mat header row width.
0 0 10 the remaining width will be divided equally among remaining cells.
You can get to the same dialog by right clicking the selected column s and choosing column width from the context menu.
On the home tab in the cells group click format column width.
Second option then you.
When i use a regular table with basically no css the columns auto format to fit the widest td element.
Custom width on material data table columns.
In the column width box type the desired number and click ok.
To apply custom width to columns we can create helper classes with width provided in pixes as shown below w 75 width.
With md table the columns are all set to the same width divided into the total table width except for cells that are too wide and then it extends the cell and pushes the other cells in that row to the right.
To make the columns in a table automatically fit the contents click on your table.
0 0 25 important.
0 0 5 mat cell nth child 5 mat header cell nth child 5 flex.
You can create any number of these custom width classes according to your requirements.
Mat table wrapper mat table min width.
Mat row width.
Mat table wrapper mat table min width.
Use auto and min or max width like this.
Mat row width.
On the layout tab in the cell size group click autofit and then click autofit contents.
Mat header row width.
Setting different width for column in style sheet by overriding the both cell and header cell.
Setting custom width for 1st and 5th column mat cell nth child 1 mat header cell nth child 1 flex.
0 0 25 important.