Table headers in exported files for dt 2.0.0
Table headers in exported files for dt 2.0.0
mdellanave83
Posts: 33Questions: 3Answers: 0
Hi,
I'm trying to understand why if I export my data with the export buttons in dt 2.0.0 the table headers are not showing.
The same code with dt 1.13.8 works.
I'm using a function here
exportOptions: {
format: {
header: () => {
return 'my-header';
}
}
}
some idea?
Replies
See these two threads with the same issue:
https://datatables.net/forums/discussion/78366/export-csv-cant-change-footer-value-when-value-are-modify-using-exportoptions#latest
https://datatables.net/forums/discussion/78370/buttons-3-3-0-and-exportoptions-format-header-no-working#latest
Kevin
I'll tag and release Buttons 3.0.1 with the fix in the next two or two.
Allan
I found what was causing the issue.
I was replacing the content of the thead th with my custom content but if I put my custom content in the span.dt-column-title instead, it works.
thank you
Yes! There is a fix in Buttons for that (overwriting the column title span), which will be included in the 3.0.1 release.
Allan