Open beingnin opened 7 years ago
I've same issue solution for fetching rows paginated?
<script> $(document).ready(function(){ var table = $('#dataTable-Name').DataTable();
$('#btn-export').on('click', function(){
$('<table>').append(table.$('tr').clone()).table2excel({
exclude: ".noExl",
name: "Excel Document Name",
filename: "myFileName" + new Date().toISOString().replace(/[\-\:\.]/g, ""),
fileext: ".xls",
exclude_img: true,
exclude_links: true,
exclude_inputs: true
}); }); }) </script>
and call above script as below:
<button id="btn-export">Export to XLS</button>
Above should export all rows irrespective of rows visible on the HTML table.
Hi @HussainMD , this works but I am not getting table headers in exported file
$('
The plugin has a limited capability that it exports only the current shown rows of a table. It will be better to add an option to export all the pages if the table is multi paged. Like a table constructed using jquery datatable plugin