vball
vball

Reputation: 389

How do I align mat-table/table content to the top of the cell?

Such as in this sample application: Link

I have a table where the data in the cells are all different heights, but instead of aligning the content to the center.

I want to align content in each cell to the top, so that the 'A's line up.
Is this possible?

Upvotes: 1

Views: 4565

Answers (2)

Felix
Felix

Reputation: 1566

Angular 15 or later:

.mat-mdc-cell {
  vertical-align: top;
}

Before Angular 15:

.mat-cell {
  vertical-align: top;
}

Upvotes: 3

e-xiste
e-xiste

Reputation: 11

After Angular Material 15, according Angular documentation : https://material.angular.io/components/table/api

.mat-mdc-cell {
  vertical-align: top;
}

Upvotes: 1

Related Questions