Print/PDF CSS and large table

Print/PDF CSS and large table

lenamtllenamtl Posts: 265Questions: 65Answers: 1

Hi,

I'm using this CSS for the table so every row have the same height.
.dataTables_wrapper th, td { white-space: nowrap; }

The problem I'm having is using Print / PDF Button it's kept the same CSS
is there a way to use .dataTables_wrapper th, td { white-space: nowrap; }
only for the table and allow the wrap in PDF and Print?

Also is there a way to Print or PDF when there is too much columns for one page ?

Thanks

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    what you want to look up is @media. It lets you apply one set of css rules on screen and a different set of rules to the printer.
    It is a part of css3

    https://www.w3schools.com/css/css3_mediaqueries.asp

  • lenamtllenamtl Posts: 265Questions: 65Answers: 1
    edited June 2017

    Hi @bindrid

    It is related to the Print and PDF Datatables Export Button function
    I'm looking for more info about the export option settings.
    Once I saw some settings about the print options and I could not found the example.

    I have a case that 20 columns may be print...
    I don't know if there is a way to set X column per page

    I'm already using the print media css, maybe I missed something

    @media print {
      .dataTables_wrapper th, td {
          white-space: normal;
      }
    }
    
    
This discussion has been closed.