Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

Set background color based on value in other cell

$
0
0
Hi,

I really love this DataTables,

Please help me. How to set background color based on value of other cell?

"aoColumnDefs": [
                {
                    "aTargets":[2], 
                    "fnCreatedCell": function(nTd, sData, oData, iRow, iCol)
                    {
                        if(sData == 'Value')
                        {
                            // How to set background color of other cell like 
                            // "aTargets":[1] $(nTd).css('background-color', 'blue'); 
                            $(nTd).css('background-color', 'blue'); 
                        }
                         
                    },                   
                }
]

Thank you in advance

Viewing all articles
Browse latest Browse all 1816

Trending Articles