'How to add footer on last page on print into datatables

I am using datatable to show list of records. To print this list, I am using print button of datatable. I want footer of table into print view because it has total of column values.

Issue is that, footer is included on every page into print view. I want footer only on last page into print view. enter image description here



Solution 1:[1]

This is actually a feature of browser printing HTML table when tfoot is set. Datatables is running the footerCallback only once, but browser is repeating the tfoot by default on every page.

You should be get around this by using the following CSS:

table tfoot {
    display: table-row-group;
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mikael Koskinen