Merging columns AND their titles?
Merging columns AND their titles?
Moghul
Posts: 7Questions: 3Answers: 0
I have managed to merge one column's data into another by using render but the title (or header) still only the original column's title.
Is there any way to merge those too? I understand that I can just start out with the right value, but I would need a more generic solution for my purposes.
This discussion has been closed.
Answers
You can use
columns.title
to set the header title. But you would need to know what this is before Datatables initializes and use a variable to set it. Otherwise, one option might be to useinitComplete
along with jQuery to set the title after initialization. Something like this maybe:$('#example th:eq(1)').html('Test');
.Kevin
That's kind of unfortunate. I was hoping there would be an option within DataTables, rather than having to make custom code.
Thanks either way.