How to add footer on last page on print into datatables

Viewed 2189

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

1 Answers

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;
}
Related