How to exclude the last two columns when exporting?
How to exclude the last two columns when exporting?
TelmoF
Posts: 1Questions: 1Answers: 0
I know about exportOptions
and I know you can exclude the last column with :not(:last-child)
, but how can you exclude the last two columns?
Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
https://datatables.net/extensions/buttons/examples/html5/columns.html
Instead of using it to exclude, use it as a selector to include. So for those columns you wish to export, add a special class to the th elements '.export-col'.
--- or ---
Add special class to columns not to be exported '.not-export-col'