If we speak about jqGrid then it's important to understand that we specify initially <table>
element like
<table id="list"></table>
which will be dynamically converted to relatively complex structure with different divs and tables which looks about at following
Specifying of CSS with .ui-jqgrid .ui-jqgrid-htable th div {...}
you can change formatting of *column headers of the grid. If you have two grids like
<table id="grid1"></table>
<table id="grid2"></table>
and want to specify CSS for column headers only one grid then you id of outer div "gbox" or "gview" which will be build based on the id of the <table>
element. For example to apply CSS which you need to the grid #grid1
only you can use
#gview_grid1 .ui-jqgrid-labels th div {
height: auto;
overflow: hidden;
padding-right: 4px;
padding-top: 2px;
position: relative;
vertical-align: text-top;
white-space: normal !important;
}
I used class ui-jqgrid-labels
of <tr>
instead of ui-jqgrid-htable
to be sure that the CSS be applied on column headers only even if you searching toolbar in the grid.