Datatable Jquery Print Specific Elements

0

How to print specific elements from outside the datatable?

Here is a sample JSFIDDLE

I wanted when I hit the PRINT button, this div below is also printed

<div id="PRINT_HERE_TOO" class="test">
   <h1>
      Print Here Too!
   </h1>
</div>

Was I clear? Thanks!

    
asked by anonymous 06.11.2017 / 15:44

1 answer

1

I think this is what you want:

link

$(document).ready(function() {
    $('#example').DataTable( {
          dom: 'Bfrtip',
        buttons: [
            {
                extend: 'print',
                messageTop: $("#PRINT_HERE_TOO").html()
               }
        ]
    } );
    
06.11.2017 / 17:10