simple-datatables icon indicating copy to clipboard operation
simple-datatables copied to clipboard

Hide columns when calling print

Open SharkFourSix opened this issue 4 years ago • 1 comments

Is it possible to remove some columns when printing?

The same way we do export({ skipColumn: [ 4 ] })

SharkFourSix avatar Oct 03 '21 20:10 SharkFourSix

since printing is using the visible html, just hide the columns?

Not tested: window.addEventListener('beforeprint', (event) => { // Hide the first and second columns columns.hide([0,1]); });

window.addEventListener('beforeprint', (event) => { // Show the first and second columns columns.show([0,1]); });

DNWEIJ avatar Nov 21 '21 22:11 DNWEIJ

Hey @DNWEIJ @SharkFourSix , please take a look at the current code. A lot has changed, but you should be able to copy and modify the print function into your own code.

johanneswilm avatar Jan 11 '23 00:01 johanneswilm