Reputation: 301
I am using angular material datatable, i want to align the contents of the header of a column vertically. I used br or p tag but it didn't work. The contents of the header of the column are still aligned horizontally. Here is the code of the header.
Upvotes: 0
Views: 532
Reputation: 502
You can use flex, set all the contents inside a parent. and on that parent set display: flex; flex-direction: column
<th mat-header-cell *matHeaderCellDef matSort >
<div class="flex-container">
<span>Name</span>
<input *ngIf="true" class="form-control" [(ngModel)]="selectInput" >
<select *ngIf="true" [(ngModel)]="selectValue" class="form-control">
<option [value]="item" *ngFor="let item of options">{{item}}</option>
</select>
</div>
</th>
.flex-container{
display: flex;
flex-direction: column;
}
Upvotes: 1