Dynamic Nested headers with colspan
Dynamic Nested headers with colspan
nitish1024
Posts: 2Questions: 0Answers: 0
I want to create a data table dynamically through javascript array(which contains the header list). I have created the table with dynamic single row header. I am trying form last 2 days to create the nested headers.Is there any way I can create nested headers or not?
For e.g
-----------------------------------------------------------
First | Second
------------------------------------------------------------
One | Two | Three | Four | Five | Six |......
------------------------------------------------------------
Row1.......................
Row2....................
Here the First header has colspan of 3 and Second 4. How can I create this through javascript array....I mean dynamically.
Thanks,
Nitish
For e.g
-----------------------------------------------------------
First | Second
------------------------------------------------------------
One | Two | Three | Four | Five | Six |......
------------------------------------------------------------
Row1.......................
Row2....................
Here the First header has colspan of 3 and Second 4. How can I create this through javascript array....I mean dynamically.
Thanks,
Nitish
This discussion has been closed.
Replies
Standard DOM methods would allow you to do that - just insert the HTML you want and then apply DataTables to the table. DataTables column creation itself does not support colspan / rowspan creation as it would add a significant amount of code and complexity to the core library for something that would not be used the majority of the time - hence the need to do it as you would without DataTables.
Allan