Dynamic Nested headers with colspan

Dynamic Nested headers with colspan

nitish1024nitish1024 Posts: 2Questions: 0Answers: 0
edited May 2012 in General
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

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    > Is there any way I can create nested headers or not?

    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
  • nitish1024nitish1024 Posts: 2Questions: 0Answers: 0
    Thanks allan for the info. I was wasting my time for searching for it from last two three days. I can insert that nested header through jquery after rendering the table.
This discussion has been closed.