Search code examples
cssangularhtml-tablemat-table

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?


Solution

  • Angular 15 or later:

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

    Before Angular 15:

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