如何重新设置ng-grid的标题? 特别是如何更改标题行的背景颜色和文本颜色?
答案 0 :(得分:5)
您可以覆盖background-color
中声明的.ngHeaderCell
类的ng-grid.css
属性,以便在标题单元格中使用所需的背景颜色。
如果你不想修改原始的ng-grid css,你可以创建自己的css并在ng-grid的css之后加载它,你可以在以后用同一个.ngHeaderCell
类覆盖:
.ngHeaderCell {
background-color: [your background color] !important;
bottom: 0;
color: [your foreground color] !important;
position: absolute;
top: 0;
}
答案 1 :(得分:2)
我以前没有看过ng-grid,但是看起来像是为样式提供了css文件?我建议更改实际的css文件,或者通过在声明grid.css的地方声明自己的下面来覆盖这些更改。如果您正在谈论的话,请检查链接。
https://github.com/angular-ui/ng-grid/blob/master/ng-grid.css
例如,上面文件中的一个css属性如下所示,只需执行ctrl -f并找到您要更改的属性。
.ngHeaderCell {
position: absolute;
top: 0;
bottom: 0;
background-color: inherit;
}