sarojthapa60 Posted November 2, 2016 Share Posted November 2, 2016 I have a Datatables using HTML (DOM) sourced data. I have 30 columns in my table. I have a print button, button when I print about 6 columns do not fit. Also, some cells have background colors. How can I customize this Print function so that I can print 11 by 17 preserving the background colors of the cells? My script for Datatables: <script> $(document).ready(function() {$('#myTable').DataTable( {"order": [[0, "asc"]],"paging": false,"scrollCollapse": true,"columnDefs": [{"targets": [0],"visible": false,"searchable": false}],dom: 'Bfrtip',buttons:[{extend: 'print',text: 'Print',}]} );} );</script> Quote Link to comment https://forums.phpfreaks.com/topic/302452-print-11-by-17-using-datatables-plugin-with-background-cell-colors/ Share on other sites More sharing options...
cyberRobot Posted November 4, 2016 Share Posted November 4, 2016 ...preserving the background colors of the cells? As far as I'm aware, whether a page prints with background colors is determined by the user's browser. In Chrome, for example, there is a "Background Graphics" checkbox in the print dialog under "More Settings". Quote Link to comment https://forums.phpfreaks.com/topic/302452-print-11-by-17-using-datatables-plugin-with-background-cell-colors/#findComment-1538934 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.