Does Datatables always require a pre-existing HTML table to exist first?
Does Datatables always require a pre-existing HTML table to exist first?
Basementjack
Posts: 19Questions: 7Answers: 0
Hi, just starting with Datatables,
All the examples I see look like they start out with an HTML table before DT gets to work.
If I'm using an ajax data source, is it possible to skip that and just include an empty
<table ID="mytable"></table>
Or do the tables always need to be complete with the columns that we expect from Datatables?
- Jack
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Yes you can just use an empty table tag. Use the
columns.title
option to set the column header title when DataTables constructed your columns.DataTables will automatically generate the
thead
andtbody
elements as required.Allan
Thanks Allan!