I’m having difficulty printing a DataTable in landscape mode. Here is the code I’m using:
var table = jQuery('#dyntable_client_orders').DataTable({
lengthChange: true,
//responsive: false,
buttons: ['copy', 'excel', 'pdf', 'colvis',{
extend: 'print',
customize: function ( win ) {
console.log(win.styleMedia.type);
win.styleMedia.type = 'print';
}
}]
});
I also tried this:
var table = jQuery('#dyntable_client_orders').DataTable({
lengthChange: true,
//responsive: false,
buttons: ['copy', 'excel', 'pdf', 'colvis',{
extend: 'print',
orientation: 'landscape'
}]
});