showing results for - "jquery datatable text color"
Flavie
10 Oct 2017
1$(document).ready( function () {
2  var table = $('#example').DataTable({
3    columnDefs: [{targets: [0, 1, 2, 3, 4, 5],
4                    render: function ( data, type, row ) {
5                      var color = 'green';
6                      if (data == "example") {
7                        color = 'green';
8                      } 
9                      if (data > 10) {
10                        color = 'blue';
11                      }
12                      if (data < 60) {
13                        color = 'red';
14                      }
15                      return '<span style="color:' + color + '">' + data + '</span>';
16                    }
17               }]
18  });
19} );