Reputation: 75
Can anyone help in providing code for responsive datatable with export option, which enables to export data from the table.
Upvotes: 1
Views: 1592
Reputation: 917
Try this it may help you
<script src="js/datatables/jquery.dataTables.min.js"></script>
<script src="js/datatables/dataTables.bootstrap.min.js"></script>
<script src="js/datatables/dataTables.buttons.min.js"></script>
<script src="js/datatables/buttons.bootstrap.min.js"></script>
<script src="js/datatables/jszip.min.js"></script>
<script src="js/datatables/pdfmake.min.js"></script>
<script src="js/datatables/vfs_fonts.js"></script>
<script src="js/datatables/buttons.html5.min.js"></script>
<script src="js/datatables/buttons.print.min.js"></script>
<script src="js/datatables/buttons.colVis.min.js"></script>
var table = $('#example').DataTable({
lengthChange: false,
buttons: [ 'copy', 'excel', 'pdf', 'colvis' ]
});
table.buttons().container().appendTo( '#example_wrapper .col-sm-6:eq(0)' );
EDIT:
You will find the details on plugin download link on. https://www.datatables.net/extensions/buttons/examples/html5/simple.html
Upvotes: 1