Jump to content

Print 11 by 17 using Datatables Plugin with Background Cell Colors


Recommended Posts

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>

Link to post
Share on other sites

...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".

Link to post
Share on other sites
This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.