Is there a way to target table header using export options while exporting?
Is there a way to target table header using export options while exporting?
rpras
Posts: 1Questions: 1Answers: 0
I want to change the table header text when exporting. Is there a way to do this? The below example is for a col but when I use row === 0 to compare, the comparison targets table data row index 0.
var buttonCommon = {
exportOptions: {
format: {
body: function ( data, row, column, node ) {
// Strip $ from salary column to make it numeric
return column === 5 ?
data.replace( /[$,]/g, '' ) :
data;
}
}
}
};
Can someone help me with this?
This discussion has been closed.
Answers
I am also looking to change the table header text when exporting. Were you able to find a way of doing that?
Was able to resolve this issue using this post: https://datatables.net/forums/discussion/comment/111985/#Comment_111985.
Here are the code changes:
... and then in your buttons definitions: