Hi I am using jQuery Datatables 1.10. I am trying to export Datatable multiple header rows but not getting. But it is Exporting only second header row. I am using Buttons:
Hi maybe I'm a little late but I hope my answer can help someone else. I exported all rows using an extra library, in my case, table2excel. I just copied the header rows using html() function and getting all the rows with .DataTable() function. The code looks as follows:
$("#exportExcel").click(function(){
$('')
.append(
$("#table1 thead").html()
)
.append(
$("#table1").DataTable().$('tr').clone()
)
.table2excel({
exclude: "",
name: "casting",
filename: "ExportedData.xls"
});
});
It solved the problem in my case.
- 热议问题