如何更改Angular Material Table行高?

问题描述 投票:1回答:2

在我的Angular应用程序(使用Angular Material设计)中,我需要使用Material Table显示一些数据。

该表有一个粘性标题,几行和一个粘性页脚。

默认情况下,行的高度为62.5px,我想覆盖此值。

我怎样才能实现这一目标?

我试过覆盖tr / tr.mat-row / tr.mat-h​​eader-row等的css样式,但没有成功。我也尝试过使用:: ng-deep。

另外,我的粘性页脚行高48px,我没有设置!!有谁知道发生了什么?

Table picture

我能够用:: ng-deep编辑页脚行css,我已经将font-weight设置为粗体,但是当我设置height属性时没有任何反应。

::ng-deep tr.mat-footer-row {
border: 1px solid #e7e7e7;
font-weight: bold;
}

谢谢!

html css angular row material
2个回答
0
投票

尝试在styles.scss上添加它。

tr.mat-footer-row {
        border: 1px solid #e7e7e7;
        font-weight: bold;
        height: #px !important;
}

0
投票

您可以在tr.mat-footer-row中指定表格页脚的高度。

tr.mat-footer-row {
    height: 100px;
}

这是StackBlitz的例子https://stackblitz.com/angular/gjjjdpjqvvde?file=app%2Ftable-sticky-footer-example.css

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.