How to add another header row when the datatable is created dynamically
How to add another header row when the datatable is created dynamically

Hi,
my datatable is created dynamically, I've created an example on http://live.datatables.net/lor/6/edit?html,js,output
This will create a table with one header row and two data rows.
What is the best way to add another header row?
I'm trying to add it using jQuery using the following code:
var firstHeaderRow = dataTable.table().header();
var header = $(dataTable.table().header());
var secondHeaderRow = firstHeaderRow;
$(firstHeaderRow.rows[0]).after($(secondHeaderRow).html());
But this is not working correctly and I don't think this is the right way to do it? Or is it?
Please help,
kind regards,
Richard
my datatable is created dynamically, I've created an example on http://live.datatables.net/lor/6/edit?html,js,output
This will create a table with one header row and two data rows.
What is the best way to add another header row?
I'm trying to add it using jQuery using the following code:
var firstHeaderRow = dataTable.table().header();
var header = $(dataTable.table().header());
var secondHeaderRow = firstHeaderRow;
$(firstHeaderRow.rows[0]).after($(secondHeaderRow).html());
But this is not working correctly and I don't think this is the right way to do it? Or is it?
Please help,
kind regards,
Richard
This discussion has been closed.
Replies
Allan