If you want to change the color of the whole column then you should better to use classes
property of the column and optionally labelClasses
if you use my fork of jqGrid (free jqGrid) and you want to change the column of the column header additionally.
It's important that you define the CSS rule for the class used in classes
/ labelClasses
correctly. If you need set the background-color
then you should set background-image: none;
additionally to remove the background image inherited from jQuery UI classes.
Alternately you can use cellattr
callback in the column to set the class
or style
attribute on all cells on the column. See the answer for more details.
It's important to remark, that there are no way to set some CSS property on the column of HTML <table>
. One can set the property only on the row (<tr>
) or on the cell (<td>
). In general one could use col
and colgroup
, but it have very restricted possibilities and the possibilities depend on HTML version which one use and from the web browser. All attempts to use it practically failed and jqGrid don't use the possibility.