如何更改ngx数据表标题背景颜色?

问题描述 投票:0回答:2
css angular ngx-bootstrap scss-mixins ngx-datatable
2个回答
0
投票

尝试下面的CSS

  .ngx-datatable ::ng-deep .datatable-header-inner{
    background-color: blue !important;
  }
  .ngx-datatable ::ng-deep .datatable-header-inner .datatable-header-cell-label,
  .ngx-datatable ::ng-deep .datatable-header-inner .sort-btn{
    color: white !important;
  }

Stackblitz 演示


0
投票

如果您使用

css
,您需要在
css
文件中添加以下样式。

/deep/ .ngx-datatable .datatable-header {
  background-color: blue;
}

如果您使用

scss
,您需要在
scss
文件中添加以下样式。

::ng-deep {
  .ngx-datatable {
    &.datatable-header {
      background-color: red;
    }
  }
}

请检查这个stackblitz

致以诚挚的问候。

© www.soinside.com 2019 - 2024. All rights reserved.