Buttons (Print, Excel, PDF) not showing in my datatables
Buttons (Print, Excel, PDF) not showing in my datatables

Hello. I just wanna ask why the buttons are not showing in my datatables.
Here are my codes
$(document).ready(function() {
$('#example').DataTable({
buttons: [
{ extend: 'print', exportOptions:
{ columns: ':visible' }
},
{ extend: 'copy', exportOptions:
{ columns: [ 0, ':visible' ] }
},
{ extend: 'excel', exportOptions:
{ columns: ':visible' }
},
{ extend: 'pdf', exportOptions:
{ columns: [ 0, 1, 2, 3, 4 ] }
},
{ extend: 'colvis', postfixButtons: [ 'colvisRestore' ] }
],
});
});
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/jq-3.3.1/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-colvis-1.6.1/b-html5-1.6.1/b-print-1.6.1/datatables.min.css"/> //in the head section
//in the script tag
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/jq-3.3.1/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-colvis-1.6.1/b-html5-1.6.1/b-print-1.6.1/datatables.min.js"></script>
This discussion has been closed.
Answers
You need to add the 'B' option in
dom
for Buttons - example here.Colin