How to set Angular mat-table column width

Follow the below steps to set the width of Angular mat-table column.

  1. Identify the mat-table column class name.
  2. The table class name will be mat-table column field name prefixed with mat-column, so the class will be like mat-column-fieldName.
  3. Finally, add the width and if required add min-widthand max-width CSS properties to the column class names.

For example if the mat-table column field name is email, then angular will add a class named mat-column-email to the email columns i.e., td selectors.

Let’s go through an example to understand it further.

 displayedColumns: string[] = [

For each and every mat-table column, the following CSS classes will be added.

mat-table column width

mat-table column width

To Set the email column width as 200px, add the CSS to the mat-column-email class.


If the column text is long, based on the biggest column text, the width will be calculated and applied accordingly.

For example consider below example.


Arun Kumar Gudelli|

The second row column text is longer than the first one and If the lengthy column text takes 100px size, the size 100px will be applied to all rows. That means minimum width will be applied.

Arun               | 100px
Arun kumar Gudelli | 100px

So if you set the width of the mat-column size as 50px still it takes 100px and our CSS won’t have any effect on the UI.

 width :50px;

So If you want set the exact width as 50px, You need to add max-width as well.

 width :50px;

Further you need to add word-wrap:break-word CSS property so that the text will be wrapped to the next line setting mat-table column width as 50px.

Arun       | 50px
Arun kumar |
Gudelli    | 50px

Similarly If you want to set minimum width to mat-table column use min-width CSS property.

 width :75px;

mat-table column width example StackBlitz Demo

Here is the demo for mat-table column width example


Arunkumar Gudelli

Liked this post? Subscribe