Print button with a specialized Print.css file

Print button with a specialized Print.css file

Bsim26Bsim26 Posts: 1Questions: 0Answers: 0

When you're using the initialization of the print button, is there any possible way to use an external print.css file for use in the Datatables print button with an incredibly old dot-matrix printer? If anyone can point me in the right direction the would be wonderful!

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    The simplest way to style your printing is probably by using your own CSS file.
    You would reference it in your HTML like so:

    <div>
    <link rel="stylesheet" href="your_print_style.css" type="text/css" media="print" />
    

    (The div is unnecessary.)
    I have no reason to think that DataTables would interfere with this, but I'm no expert.

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    @tangerine is correct - DataTables won't mess with that stylesheat - it will be included on the exported table's page ready for print. Alternatively, you could use the customize callback of the print button type to inject that link into the print view.

    Allan

  • kowadagokowadago Posts: 24Questions: 5Answers: 2

    But doesn't dataTable Print button remove all classes from the table in the print view page??

  • allanallan Posts: 63,464Questions: 1Answers: 10,466 Site admin

    The classes for the table itself should still be present.

    Allan

This discussion has been closed.