在Angular5应用程序中,我使用Material表来显示一些数据。
进入一个
mat header cell
i am having a
span
and a
img
together and trying to align them properly.
现在的样子是:
这里是件HTML代码:
<ng container matcolumndef=“batchstate”>
<mat header cell*matheadercelldef style=“border:1px solid white;”>
<span style=“border:1px solid white;”>批处理状态</span>
<img style=“border:1px solid white;”src='../../assets/filter_list.png'(单击)=“filterbystate()”
mattooltip=“按状态筛选”/>
</mat标题单元格
<mat cell*matcelldef=“let inst”>
仪器批次状态
</mat单元格
</ng容器
< /代码>
我想让我的span显示在单元格的中间左侧,Treedtext-Align:Center;Left:0px;andpadding-top:25%;padding-bottom:25%(inside my span element)but these css did not work,any way to reach that?img
把它们放在一起,试着把它们对齐。
现在的情况如下:
![enter image description here](https://i.stack.imgur.com/wZunW.png)
这里是件HTML代码:
<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>
我想要我的跨度
要显示在单元格的左中,请尝试text-align:center; left:0px;
和padding-top: 25%; padding-bottom: 25%
(在我的SPAN元素中)但是那些CSS不起作用,有没有办法做到这一点?