如何更改Jqgrid中标题和行的背景?

时间:2012-02-13 07:29:17

标签: css jqgrid

我需要更改标题的背景以及Jquery网格的行。我试图改变几个css类但我没有得到我想要的结果。

2 个答案:

答案 0 :(得分:1)

// this changes the background image of the header
.ui-jqgrid .ui-widget-header{
   background-image: url(myBackground.jpg) repeat-x !important;
}

// this changes the background color of every row in a jqgrid
.ui-jqgrid tr.jqgrow {
    background-color: yellow !important;
}

注意: !important可能没有必要。

还要确保你的css文件在 jqgrid的css文件之后加载

<link rel="stylesheet" type="text/css" media="screen" href="ui.jqgrid.css" />
<!-- load jqgrid css first then your css -->
<link rel="stylesheet" type="text/css" media="screen" href="mystyle.css" />

答案 1 :(得分:0)

//for changing colour of titlebar
#list .ui-jqgrid-titlebar {
background:blue;
}
//for changing header
.ui-jqgrid .ui-jqgrid-htable th{
background: blue
}