0

hello there guys I have a question this might be newbie question

I have a datatable in my website now I want to print or export it in excel file the problem I am getting is that the tag <tfoot></tfoot> was not included in printing and in export

this are my code:

JS:

<script type="text/javascript" class="init">
$(document).ready(function() {
  $('#example').DataTable( {
    dom: 'Bfrtip',
    buttons: [
      {
        extend: 'print',
        customize: function ( win ) {
          $(win.document.body)
            .css( 'font-size', '10pt' )
            .prepend(
              '<img src="http://datatables.net/media/images/logo-fade.png" style="position:absolute; top:0; left:0;" />'
            );

          $(win.document.body).find( 'table' )
            .addClass( 'compact' )
            .css( 'font-size', 'inherit' );
        }
      }
    ]
  } );
} );

</script>

1 Answer 1

1

You can add footer: true option.

// ...
extend: 'print',
footer: true,
// ...

For more information, take a look here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.