Print multiple data tables on a single button click
Print multiple data tables on a single button click
ashishprsspl
Posts: 4Questions: 1Answers: 0
Hello,
i came across this but this doesnt seem to have the answer there.
https://datatables.net/forums/discussion/30129/print-screen-or-multiple-tables-with-single-button
I have the similar situation. i have 2 data tables on same page and i want them to print on a single button click in a single view. how do i do it?
This discussion has been closed.
Answers
Anyone can answer me this?
any update here?
Hi,
As I stated in the thread that you linked to, there is no built in way to print multiple tables using a single button at the moment. That is a feature that you would need to create using a custom button.
Allan
I didn't have the expertise to create a custom button, so i did a belt and braces solution.
i put both tables within a div, which i called printsection
i used a jquery plugin called printarea https://github.com/RitsC/PrintArea to print out the contents of the div
see also http://www.codexworld.com/print-specific-area-of-web-page-using-jquery/
Nice one - thanks for sharing that with us!
Allan
I read about it before but thanks anyways. This doesn't work for me as my table contains paging.
Yup - in that case you would indeed need to create a custom button that uses
buttons.exportData()
to get the data from each table and then create a print view.Allan