DataTables warning: Requested unknown parameter ‘0’ from the data source for row ‘0’

For null or undefined value error, Just add this line to attributes : ,columnDefs: [ { “defaultContent”: “-“, “targets”: “_all” } ] Example : oTable = $(“#bigtable”).dataTable({ columnDefs: [{ “defaultContent”: “-“, “targets”: “_all” }] }); The alert box will not show again, any empty values will be replaced with what you specified.

Datatables: Change cell color based on values

First of all, initialize DataTable only once. Then as per your question, use rowCallback and not fnRowCallBack as shown below: var oTable = $(‘#countryTable’).DataTable({ ‘rowCallback’: function(row, data, index){ if(data[3]> 11.7){ $(row).find(‘td:eq(3)’).css(‘color’, ‘red’); } if(data[2].toUpperCase() == ‘EE’){ $(row).find(‘td:eq(2)’).css(‘color’, ‘blue’); } } }); Here’s a fiddle

dataTable() vs. DataTable() – why is there a difference and how do I make them work together?

Basically, the two constructurs return different objects. dataTable constructor var table = $(<selector>).dataTable() dataTable is the oldschool dataTables constructur, which returns a jQuery object. This jQuery object is enriched with a set of API methods in hungarian notation format, such as fnFilter, fnDeleteRow and so on. See a complete list of API methods here. Examples … Read more