In my angular5 application, I am utilizing a material table to showcase some data.
Within a mat-header-cell
, I have a combination of a span
and an img
, and I'm attempting to align them correctly.
This is how it currently appears:
https://i.sstatic.net/wZunW.png
Below is the snippet of HTML code:
<ng-container matColumnDef="batchState">
<mat-header-cell *matHeaderCellDef style="border: 1px solid white;">
<span style="border: 1px solid white;">Batch state </span>
<img style="border: 1px solid white;" src='../../assets/filter_list.png' (click)="filterByState()"
matTooltip="Filter by state" />
</mat-header-cell>
<mat-cell *matCellDef="let inst">
{{inst.batchState}}
</mat-cell>
</ng-container>
I desire for my span
to be positioned centrally at the left-hand side of the cell. I've attempted using text-align:center; left:0px;
and
padding-top: 25%; padding-bottom: 25%
(inside the span element), but these CSS styles did not take effect. Is there any other method to achieve this?