change the column BG color depending on the

change the column BG color depending on the

jyothisrinivasjyothisrinivas Posts: 3Questions: 0Answers: 0
edited June 2012 in DataTables 1.9
Hi,
I have been using datatables, its amazing and wonderful. I have been struck with one of the problem. On the datatables, I have 7 columns. These 7 columns have background color changes depending on the server data. I need to change the background color for the corresponding . Could you please help me on this? I guess i need to use fnheadercallback. But need to know how to capture and get the backgroundcolor for the cells.

Thanks and regards,
Jyothi

Replies

  • jyothisrinivasjyothisrinivas Posts: 3Questions: 0Answers: 0
    Hi , how can i achieve the following counter functionality with datatables? I have the below jquery



    Header 1
    Header 2




    row 1, cell 1
    row 1, cell 2


    row 2, cell 1
    row 2, cell 2



    function assigncolr(col, index) {
    $('#one tbody tr').each(function() {
    $(this).find('td:nth-child(' + (index + 1) + ')').css("background-color", col);
    });
    }
    $(document).ready(function() {
    $('#one thead tr th').each(function() {
    var col1 = $(this).css("background-color");
    var index = $(this).closest("th").prevAll("th").length;
    assigncolr(col1, index);
    });
    });
This discussion has been closed.