Data table data-footer-formatter value is not showing on print preview
Data table data-footer-formatter value is not showing on print preview
Hi I have a data table and I am getting a total of two columns through jquery with the help of data-footer-formatter. Now the issue is that the total value is showing normally at the footer but when I click on the print button and in print view these footer values disappear Now please tell me how I can apply CSS on this data-footer-formatter or can be appeared
The screenshot is here:
Normal highlighted value![(https://datatables.net/forums/uploads/editor/q3/7uizwql96bd7.jpg "")]
On print preview, These highlighted values disappear.![(https://datatables.net/forums/uploads/editor/if/k3sq17sy3xoy.jpg "")]
**Code for getting total is here
<th data-field="debit" data-align="center" data-footer-formatter="totalFormatter" data-filter-control="input">
<?php echo "Debit"; ?>
</th>
<th data-field="credit" data-align="center" data-footer-formatter="totalFormatter" data-filter-control="input">
<?php echo "Credit"; ?>
</th>
Script:
function totalFormatter(data) {
var total = 0;
// console.log(data);
if (data.length > 0) {
var field = this.field;
total = data.reduce(function(sum, row) {
return sum + (+row[field]);
}, 0);
return total.toLocaleString();
}
return '';
};
**
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
Answers
Kindly help I am stucked
Can you give me a link to a page showing that issue please? I'm a little surprised that isn't showing the footer data in the HTML output.
Thanks,
Allan