simple-datatables
simple-datatables copied to clipboard
Hide columns when calling print
Is it possible to remove some columns when printing?
The same way we do export({ skipColumn: [ 4 ] })
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]); });
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.