DataTables is a very powerful list control, can give developers to save a lot of page development, OK, we directly into the title, modify the contents and style of DataTables cell, very simple to see the code
Modify Style
var table = $ (' #table_id '). DataTable ({ ...... " Createdrow ": function ( row, data, index ) { if ( data[ ' Opnum '] > 1000 ) {//red display with more than 1000 operation Times $ (' TD ', Row). EQ (1). css (' font-weight ', ' bold '). CSS ("Color", "red"); } }, &nBSP;        &NBSP, ...});
In doing so, the contents of the first column satisfying the condition (the DataTables column subscript is starting from 0) will turn red.
Modify Content
var table = $ (' #table_id '). DataTable ({ ...... " Createdrow ": function ( row, data, index ) { if ( data[ ' ProductName '] == ' iphone6 plus ' ) { $ (' TD ', row). eq (2). HTML ('-'); } }, });
If the product is 6p, then the cell reset to-, no goods, hehe
All right, it's that simple, try it.
Modify the contents and style of the cell format in the DataTables list