Answers for "jquery datatable background 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
1

jquery datatable background text color

$(document).ready( function () {
  var table = $('#example_table').DataTable({
    columns: [
      {
        data: "example_data",
        render: function (data) {
          if (data == true) {
            return '<h5><span class="badge badge-success">Example</span></h5>';
          } else {
            return '<h5><span class="badge badge-danger">Another Example</span></h5>';
          }
        },
      },
    ]
  });
} );
Posted by: Guest on June-05-2021

Code answers related to "jquery datatable background text color"

Code answers related to "Javascript"

Browse Popular Code Answers by Language