I created Dynatable, I dynamically created table headers. Dynatable gives an error when it starts because it cannot find headers in HTML.
ERROR: Error during collection: could not find column headers in 'thead tr th, etc. If the title bar is different, specify the selector in table: headRowSelector.
CM. FIDDLE: https://jsfiddle.net/0ycqnaxg/6/
It really works if the HTML contains:
Working FIDDLE: https://jsfiddle.net/0ycqnaxg/9/
<thead> <th>FirstName</th> <th>LastName</th> </thead>
But I left thead empty to allow dynamic creation.
- Dynatable "thead tr" headRowSelector, "th" . - "thead" headRowSelector.
$('#my-table').dynatable({ table: { headRowSelector:'thead', }, dataset: { records: columns } });
Datatables. , . , datatables ;
$('#example thead tr,tfoot tr').append('<th>' + value + '</th>');