Print button results in printed header with Exported data
Print button results in printed header with Exported data
using DataTables 1.13.8, Buttons 2.4.2, HTML5 export 2.4.2, Print view 2.4.2:
let table = new DataTable('#historyTable', {
lengthMenu: [
[-1, 10, 25, 50, -1],
['ALL', 10, 25, 50]
],
buttons: ['print'],
dom: '<"my-custom-title"><"top"Bf>rt<"bottom"ip><"clear">'
});
I've been trying to get the heading that I have into the actual print from the print button. However, I only get a giant, "Exported data" on the top of the page.
I've tried various solutions found online, but they're probably for older versions of datatables.
For example, I tried this solution: https://github.com/aravindnc/Buttons/wiki/How-to-add-title-and-image-header-to-all-pages-while-printing-using-DataTable but it didn't work.
can you please help?
Answers
See if this example answers your questions.
Kevin
What heading?
Are you able to give me a link to the page in question please?
The
title
andmessageTop
options ofprint
can be used to set the content that appears at the top of the print output.Allan