改变jqgrid表头颜色

3

我正在使用jqgrid。我想改变标题栏的颜色,但是我无法做到。我不知道我犯了什么愚蠢的错误。我尝试了这个方法,但它没有起作用。

.ui-th-column, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column {
    border-bottom: 0 none;
    border-top: 0 none;
    overflow: hidden;
    text-align: center;
    white-space: nowrap;
    background: orange;
}

我还尝试了 .ui-jqgrid .ui-widget-header{background-color: yellow !important;},但它也没有生效。


http://jsfiddle.net/rsHmj/56/ - Umesh Sehta
使用类似Chrome Inspector的工具,检查元素及其父级元素的类。 - Jai
2个回答

4
尝试使用。
.ui-jqgrid .ui-widget-header {
    background-color: orange;
    background-image: none
}

它改变标题栏的背景颜色。要更改列标题的背景颜色,您应该使用例如以下CSS规则。

```css th { background-color: your_color; } ```
.ui-jqgrid .ui-jqgrid-labels th.ui-th-column {
    background-color: orange;
    background-image: none
}

如果想要设置背景颜色并移除背景图片,可以通过设置background属性(例如background: orange;)来一次性设置多个属性(background-colorbackground-imagebackground-repeatbackground-attachmentbackground-position)。


当然,我刚才错过了它。完成。 - Bran Smith

0
请使用以下方式:
.ui-widget-header {
    border: 1px solid yellow;
    background: none;
    background-color: yellow !important;
}

我已经尝试过了,但它仍然没有起作用。任何更改都不会影响jqgrid。我不知道原因。 - Bran Smith
我把它放在ui.jqgrid.css文件中。 - Bran Smith

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接