DataTable header
DataTable header
maheshb
Posts: 11Questions: 2Answers: 0
Hi, I am changing table header<th> element on fly. When I export data to csv or excel, new table header is not exported but the old one is exported. Thanks
This discussion has been closed.
Replies
Please link to a test case showing the issue, as per the forum rules.
http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read
Currently this is a limitation in TableTools. It will always read the stored value that was read during DataTables initialisation. There is no way around it other than to modify TableTools to read the innerHTML of the element.
Allan
Thanks alot tangerine and allan.
Can you guys put some light how to override header with tabletools. I googled but didnt got any clue.
In my case there are 2 DataTable and 1 tabletool button.
Following link has javascript code for tabletool,
http://live.datatables.net/hakutoze/1/
Google won't help much - you need to read the TableTools source code. Specifically here. Use your browser developer tools to inspect that
dt.aoColumns[i]
is.Allan
Hi allan
This solution worked for me
https://datatables.net/forums/discussion/22592/export-multiple-row-headers
Thanks
I ended up using a function based on the one described here to export to Excel instead of the Tabletools built-in one that only exports to CSV:
http://www.codeproject.com/Tips/755203/Export-HTML-table-to-Excel-With-CSS