我需要对角分割 Mat Table 单元格。并需要根据值添加值和颜色。像这样...
这是我的代码 .html
<ng-container matColumnDef="RearIdler">
<mat-header-cell class="eval-header" *matHeaderCellDef> {{Translate('Rear Idler')}} </mat-header-cell>
<mat-cell *matCellDef="let row" class="no-padding">
<div>
<span class="component-span top {{getComponentHoursClass(7,1, row.Components)}}">
{{getComponentHours(7,1, row.Components)}}
</span>
<span class="component-span top {{getComponentClass(7,1, row.Components)}}">
{{getComponentValue(7,1, row.Components)}}%
</span>
</div>
<div>
<span class="component-span bottom {{getComponentHoursClass(7,2, row.Components)}}">
{{getComponentHours(7,2, row.Components)}}
</span>
<span class="component-span bottom {{getComponentClass(7,2, row.Components)}}">
{{getComponentValue(7,2, row.Components)}}%
</span>
</div>
</mat-cell>
</ng-container>
.css
.component-span {
display:block;
border-radius: 4px;
text-align: center;
margin: 1px;
padding: 4px 2px;
font-size: 12px;
}