$('#example').DataTable({ headerCallback: function headerCallback(thead, data, start, end, display) { $(thead) .find('th') .first() .html('Displaying ' + (end - start) + ' records'); } }); Note that the first parameter might actually be the first tr inside the thead, not necessarily the thead element itself, contrary to what is stated in the DataTables documentation. In complex scenarios with multiple header rows (trs), you might need to select like this: $('#example').DataTable({ headerCallback: function headerCallback(thead, data, start, end, display) { $(thead) .closest('thead') .find('th') .first() .html('Displaying ' + (end - start) + ' records'); } });
Personalizzare le celle th di una DataTable