how to describe the header structs of complex headers in json?

how to describe the header structs of complex headers in json?

bikaibikai Posts: 21Questions: 12Answers: 0
edited May 2016 in Free community support

I'm using complex headers feature in the page bellow:
https://datatables.net/examples/basic_init/complex_header.html

in this page, the header is writted fixed in html:

<thead>
    <tr>
        <th rowspan="2">Name</th>
        <th colspan="2">HR Information</th>
        <th colspan="3">Contact</th>
    </tr>
    <tr>
        <th>Position</th>
        <th>Salary</th>
        <th>Office</th>
        <th>Extn.</th>
        <th>E-mail</th>
    </tr>
</thead>

but in my html, i just want a pure line bellow:

<table id="example" class="display" cellspacing="0" width="100%">

i want to get table headers throught Ajax, so my question is: How to describe the header structs of complex headers in json?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,920Questions: 1Answers: 10,153 Site admin
    Answer ✓

    There is unfortunately no way to do that in DataTables at the moment. Its something I hope to introduce in future, but at the moment complex headers have to be in the HTML before DataTables is initialised. That can be from the original raw HTML or you can use jQuery / DOM methods to modify the DOM to suit your needs.

    Allan

  • bikaibikai Posts: 21Questions: 12Answers: 0

    ok, thank you allan.

This discussion has been closed.