Tuesday 10 September 2019

How to fix a line at the end of table with Datatables?

I'm using Datatables and at the end of the table I have a line with a total of each columns and I would like to fix this line at the end of the table for when I'll use the sorting option this line stay at the end. You can see on the picture the line Island Total is this line I would like to fix at the of the table. For the table I get the value by AJAX request and the total is calculate is the javascript. I know I can use the footerCallBack option include in DataTables but I can't edit the total line with this method therefore I can't use the footerCallBack.

JS for the table :

$('#datatable').DataTable({
    "sPaginationType" : "full_numbers",
    "lengthMenu" : [[5, 10, 20, 30, -1], [5, 10, 20, 30, "All"]],
    "iDisplayLength" : -1,
    data : data_use,
    columns : column_name,
    dom : 'lfrtip',
    responsive : true,
    destroy : true,
    searching: true,
});

enter image description here



from How to fix a line at the end of table with Datatables?

No comments:

Post a Comment