First value color of column does not change on giving color based on data value

First value color of column does not change on giving color based on data value

sandiioticssandiiotics Posts: 3Questions: 1Answers: 0

I used the $(row).addClass() method to give color to row based on certain data, it is working but the first column element of this row color does not change. It looks odd. How to solve this issue

Answers

  • sandiioticssandiiotics Posts: 3Questions: 1Answers: 0

    var table = $('#users_data').DataTable({
    responsive: true,
    "createdRow": function( row, data, dataIndex ) {
    if ( data[4] == 'Online' ) {
    $(row).addClass('online_device');
    }
    });
    } );

    This is the code used the 'online_device' is the css class used

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
This discussion has been closed.