【问题标题】:Ng2-smart-table Single Cell stylingNg2-smart-table 单细胞样式
【发布时间】:2018-06-08 23:01:49
【问题描述】:

我希望为单元格添加自定义颜色。

尝试使用

`styles: [`    
    :host /deep/ ng2-smart-table tbody > tr > td:first-child {
    color: red;
    }
    `]`

但这会改变整个第一列的颜色

【问题讨论】:

    标签: ng2-smart-table


    【解决方案1】:

    如果您不仅要为第一个单元格着色,还需要将first-child 添加到tr

    :host /deep/ ng2-smart-table tbody > tr:first-child > td:first-child {
      color: red;
      }
    

    【讨论】:

    • 如何将此样式绑定到 ngClass ?
    • 你需要把ng2-smart-table改成你的班级,例如::host /deep/ .testColor tbody
    猜你喜欢
    • 2020-07-08
    • 1970-01-01
    • 2019-01-08
    • 2020-01-03
    • 2018-09-21
    • 2018-05-12
    • 1970-01-01
    • 1970-01-01
    • 2017-08-15
    相关资源
    最近更新 更多