我正在使用角7,材质7
我试图使用粘性的特定列,它不起作用,
Headers 变粘,但单元格没有 .
我的HTML看起来如下:
<mat-table [dataSource]="dataSourceVaccinations" matSort>
<ng-container matColumnDef="Gender" sticky>
<mat-header-cell *matHeaderCellDef mat-sort-header></mat-header-cell>
<mat-cell *matCellDef="let GetSummaryRecordsVaccinations">
<img [attr.src]="getGenderIcon(Gender)" />
</mat-cell>
</ng-container>
<ng-container matColumnDef="IdentityNumber" sticky>
<mat-header-cell *matHeaderCellDef mat-sort-header> מס' זהות </mat-header-cell>
<mat-cell *matCellDef="let GetSummaryRecordsVaccinations" > {{IdentityNumber}} </mat-cell>
</ng-container>
<ng-container matColumnDef="CodeVaccinationsAllowed">
<mat-header-cell *matHeaderCellDef mat-sort-header> ניתן לחסן סיכום </mat-header-cell>
<mat-cell *matCellDef="let GetSummaryRecordsVaccinations">
<img [attr.src]="getIcon(CodeVaccinationsAllowed)"/> </mat-cell>
</ng-container>
<ng-container matColumnDef="שפעת">
<mat-header-cell *matHeaderCellDef> שפעת </mat-header-cell>
<mat-cell *matCellDef="let GetSummaryRecordsVaccinations">
<div class="center">{{ClassDescription}}
{{VaccinationDate | date:'dd/MM/yyyy'}}
</div>
</mat-cell>
</ng-container>
<mat-header-row class="mat-row-header-vaccination" *matHeaderRowDef="displayedVaccinationsAllColumns; sticky:true"></mat-header-row>
<mat-row class="mat-row-vaccination" *matRowDef="let row; columns: displayedVaccinationsAllColumns;" (click)="selection.select(row)"></mat-row>
</mat-table>
mat-row-header
用 min-width
声明,以便添加水平滚动
我的每个列都使用如下代码的特定宽度
flex: 0 0 50px;
有什么想法解决这个问题吗?