Does anyone know how to setup mulit-row Headers using the options.columns API?
Does anyone know how to setup mulit-row Headers using the options.columns API?
We are currently dynamically generating our tables using the options.columns API and by setting the columns using JSON;
Example
var options = {
paging: false, // No paging
searching: false, // No searching
info: false, // Hide info on bottom
orderMulti: false, // No multi column ordering
ordering: false,
deferRender: true,
columns: [
{ "title": "First Name" },
{ "title": "Last Name" },
{ "title": "Job Title" }
],
columnDefs: [
{ "width": "20%", "targets": 0 }
]
};
I have a new requirement to do a multi-row header and I can't figure out the correct Json format so that Datatables will create the multi-row header. Does anyone know how to setup mulit-row Headers using the options.columns API?
Thanks
Answers
Dear Admin / Allan,
Pls provide multi row header as some invoicing application needs multiple header rows.
I think soon will purchase the license. Its really good and cool to work on tables. Amazing work.
Congrats & Thanks
Saru
There is no option to have the
columns
option setup complex headers I'm afraid (e.g.colspan
androwspan
). Instead what you have to do is create the DOM structure you want for the header using standard DOM / jQuery methods before you initialise the DataTable.Allan