css - 修复垫子对话框上垫子表的标题不起作用
问题描述
<div *ngIf="this.v_type != 'NULL'">
<div class="example-container mat-elevation-z8">
<table mat-table [dataSource]="voucherdataSource">
<ng-container matColumnDef="Credit_Card_No">
<th mat-header-cell *matHeaderCellDef>Credit Card Number</th>
<td mat-cell *matCellDef="let voucher">{{voucher.Credit_Card_No}}</td>
</ng-container>
<ng-container matColumnDef="Seller_Name">
<th mat-header-cell *matHeaderCellDef>Seller Name</th>
<td mat-cell *matCellDef="let voucher">{{voucher.Seller_Name}}</td>
</ng-container>
<ng-container matColumnDef="Account_No">
<th mat-header-cell *matHeaderCellDef>Account Number</th>
<td mat-cell *matCellDef="let voucher">{{voucher.Account_No}}</td>
</ng-container>
<ng-container matColumnDef="Buyer_Name">
<th mat-header-cell *matHeaderCellDef>Buyer Name</th>
<td mat-cell *matCellDef="let voucher">{{voucher.Buyer_Name}}</td>
</ng-container>
<ng-container matColumnDef="GST_No">
<th mat-header-cell *matHeaderCellDef>GST Number</th>
<td mat-cell *matCellDef="let voucher">{{voucher.GST_No}}</td>
</ng-container>
<ng-container matColumnDef="Invoice_No">
<th mat-header-cell *matHeaderCellDef>Invoice Number</th>
<td mat-cell *matCellDef="let voucher">{{voucher.Invoice_No}}</td>
</ng-container>
<ng-container matColumnDef="Amount_Value">
<th mat-header-cell *matHeaderCellDef>Amount Value</th>
<td mat-cell *matCellDef="let voucher">{{voucher.Amount_Value}}</td>
</ng-container>
<ng-container matColumnDef="Voucher_Type">
<th mat-header-cell *matHeaderCellDef>Voucher Type</th>
<td mat-cell *matCellDef="let voucher">{{voucher.Voucher_Type}}</td>
</ng-container>
<ng-container matColumnDef="financial_year">
<th mat-header-cell *matHeaderCellDef>Financial Year</th>
<td mat-cell *matCellDef="let voucher">{{voucher.financial_year}}</td>
</ng-container>
<ng-container matColumnDef="Voucher_Date">
<th mat-header-cell *matHeaderCellDef>Voucher Date</th>
<td mat-cell *matCellDef="let voucher">{{voucher.Voucher_Date}}</td>
</ng-container>
<ng-container matColumnDef="Filepath">
<th mat-header-cell *matHeaderCellDef>Local Filepath</th>
<td mat-cell *matCellDef="let voucher">
<a mat-icon-button href=" {{ voucher.Filepath }} " target="_blank">
<mat-icon>picture_as_pdf</mat-icon>
</a>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky:true"></tr>
<tr mat-row *matRowDef="let row;columns:displayedColumns"></tr>
</table>
</div>
</div>
我需要一个对话框上的表格的固定标题,我可以看到表格但标题不固定。在最后的第 5 行中,我使用了sticky:true,它应该修复表格的标题,但它没有修复并随着表格滚动。
解决方案
推荐阅读
- powershell - 在 .ps1 (PowerShell) 中的 if 语句中传递 $args[x] 在它不存在时似乎不起作用
- javascript - 如何验证 ng-view angularjs 中的所有页面?
- javascript - 如何在不使用 HTML 的情况下将 JS 文件导入我的 JS 文件?
- c# - 在 C# 上保存图像时参数无效
- html - 如何使可折叠按钮仅出现在移动视图中?
- android - 无法弄清楚如何将此字段保存到数据库中。我已经编写了数据类、dao 和类型转换器,但仍然无法检测到错误
- composer-php - Laravel 8 安装程序错误——“--remove-vcs”选项不存在
- javascript - 尝试在网页中显示酒店数据的 Amadeus Test Api 时出错
- amazon-web-services - 是否可以覆盖 AWS SAM 策略模板占位符变量
- python - 没有换行符的数字字符串的正则表达式