How to Export and Print Multiple Headers in Datatables?

How to Export and Print Multiple Headers in Datatables?

indu11indu11 Posts: 4Questions: 2Answers: 0

I am trying to export and print multiple headers in datatables.but it is exporting only onw row.how to export multiple header rows

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,839Questions: 1Answers: 10,518 Site admin
    Answer ✓

    Sorry, this is not a feature that the export buttons provide at the moment. There are a number of threads on this topic and it is something I plan to address in future, but it isn't currently possible.

    Allan

  • indu11indu11 Posts: 4Questions: 2Answers: 0

    Ok Thanks for reply

  • rovelarovela Posts: 2Questions: 1Answers: 0

    Thanks

  • pinchy44pinchy44 Posts: 3Questions: 0Answers: 0
    edited January 2017

    Hi,

    Is it always the current answer ?

    I found this answer :

    buttons: [
      {
        extend: 'print',
        customize: function ( win ) {
          $(win.document.body).find( 'thead' ).prepend('<div class="header-print">' + $('#dt-header').val() + '</div>');
      }
    

    with CSS :

    @media print {
      .header-print {
        display: table-header-group;
      }
    }
    
  • allanallan Posts: 63,839Questions: 1Answers: 10,518 Site admin

    That's probably an acceptable workaround until the export can truly do multiple headers.

    Allan

This discussion has been closed.