NG2-智能表单细胞造型

标签 ng2-smart-table

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

尝试使用

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

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

最佳答案

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

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

关于NG2-智能表单细胞造型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48006765/

相关文章:

angular - ng2-smart-table,对齐文本

angular - ng2-smart-table 派生列

angular - 如何删除 ng2-smart-table 中的一行

Angular2 ng2-智能表排序

angular - 在 Angular 6 中使用 ng2-smart-table 创建服务器端分页

angular - 如何使用复选框在 ng2-smart-table 组件中选择多行?

angular - ng2-smart-table 动态更新列表

Angular 5 + ng2-smart-table : Hide/disable actions column conditionally

angular - ng2-smart-table 中的复选框