I am building a jqgrid that needs different background (or in general, a different css class) value for specific cells. I know which cells need the class applied at generat
I ind your question interesting so I made the demo for you.

If you want to set some custom attributes on the grid cells ( In the demo I used the following XML input: and the In the case the 'class' attribute of the second (':eq(1)') cell will be used for the formatting. From the design point of view I would recommend you don't use the class names directly as the attributes. An alternate attribute like elements) like class, title, colspan, style the cellattr is the best way to do this (see here for details). cellattr are close to custom formatter feature, but allows to define attributes of the cell and not the cell contain.
cellattr like the followingcellattr: function () {
var c = $('cell:eq(1)', arguments[2]).attr('class');
return c ? " class='" + c + "'": "";
}
format="error" which will be converted as class='ui-state-error' have some advantages. It could make separation of information like formatting tips from direct HTML instruction.