How to create
How to create
I have a placeholder table...
<table id="demoGrid" class="table table-striped table-bordered dt-responsive nowrap" >
<thead>
<tr>
<th>Col1</th>
</tr>
</thead>
</table>
An an array of objects obtained by ajax.
var columnsx =
[
{ "data": "ExamSeriesCode", "name": "ExamSeriesCode", "autoWidth": true },
{ "data": "NoShow", "name": "NoShow", "autoWidth": true },
{ "data": "NDARefused", "name": "NDARefused", "autoWidth": true },
{ "data": "Tested", "name": "Tested", "autoWidth": true }
];
How do I drop the placeholder <th> and create one <th> in #demoGrid for each "data" : "xxxx" element in the array.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @spickens ,
You probably don't need to worry about it. If you look at this example here, you can create the table without the
thead, and it all gets filled in for you. It's based on this example, which has some more words explaining it.Cheers,
Colin
That was the trick. Thank you.