【问题标题】:sticky table header not working on angular 8粘性表格标题不适用于角度 8
【发布时间】:2019-12-25 09:29:18
【问题描述】:

我想修复 mat 表头和表中的最后一列,所以我使用了“粘性”,如角度材料文档中所示 这是我的html代码:

<mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row>

对于列:

                <ng-container matColumnDef="buttons" stickyEnd>

搜索后我没有找到解决方案,所以我认为这是关于我正在使用 8.0.2 的角材料版本

【问题讨论】:

    标签: angular angular-material mat-table


    【解决方案1】:

    请查看stackblitz here。您可以看到它使用了8.0.2 版本的角材料,并且粘性工作得很好。

    sticky: truestickyEnd 均已设置并且工作正常。

    如需更多帮助,请 fork 和编辑 stackblitz 或在问题中提供您的所有代码,我会为您提供更多帮助。

    【讨论】:

      【解决方案2】:

      您的模板 sn-ps 看起来不错。也许您的模板或CSS 中有其他内容阻止它正常工作。

      请查看以下StackBlitz,它同时具有粘性标题和粘性最后一列。

      【讨论】:

        猜你喜欢
        • 2017-09-10
        • 1970-01-01
        • 2019-04-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-06-04
        • 2019-02-14
        • 1970-01-01
        相关资源
        最近更新 更多