Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apply CSS to table cells (td) in JQGrid?

Tags:

css

jqgrid

Is there any way to apply a specific CSS class to all cells in a given column in a JQGrid?

like image 881
Herb Caudill Avatar asked Feb 27 '23 21:02

Herb Caudill


1 Answers

Based off the documentation, looks like you can give columns specific classes when setting up your colModel:

jQuery("#grid_id").jqGrid({
    ...
    colModel: [
        { name: ..., classes: "col1", ... },
        { name: ..., classes: "col2", ... },
        ...
    ],
    ...
});

Then you should be able to just style as normal, eg:

td.col1 { background-color: #f00; }
like image 85
Alconja Avatar answered Mar 08 '23 04:03

Alconja