Answers for "jquery datatable text color"

1

jquery datatable text color

$(document).ready( function () {
  var table = $('#example').DataTable({
    columnDefs: [{targets: [0, 1, 2, 3, 4, 5],
                    render: function ( data, type, row ) {
                      var color = 'green';
                      if (data == "example") {
                        color = 'green';
                      } 
                      if (data > 10) {
                        color = 'blue';
                      }
                      if (data < 60) {
                        color = 'red';
                      }
                      return '<span style="color:' + color + '">' + data + '</span>';
                    }
               }]
  });
} );
Posted by: Guest on June-05-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language