Data within DataTables can be easily rendered to add graphics or colour to your tables, as demonstrated in the example on this page. These examples make use of columns.render and drawCallback to customise the cells in three ways:1. the colour of the cell is determine by the relative price of the stock.
2. a 'sparkline' class is added to the numeric array in the 'last' column.
3. the jQuery Sparklines plugin is called to turn that array into a line graph.
Name
Symbol
Price
Difference
Last
Name
Symbol
Price
Difference
Last
ACME Gadgets
AGDTS
2.56
0.02
Sole Goodman
SGMAN
16.35
-0.01
Spry Media Productions
SPMP
1.08
0.00
Stanler Bits and Bobs
SBIBO
83.68
0.28
Widget Emporium
WDEMP
3.51
0.05
Showing 1 to 5 of 5 entries
Row Create Callback
For each row that is generated for display, the createdRow function is called once and once only. It is passed the create row node which can then be modified.the 'salary' column Primary and bold by adding a CSS class to the container cell if the salary is greater than $150,000.the 'salary' column danger and bold by adding a CSS class to the container cell if the salary is less than $40,000.