How do I get the datables tbody through .innerHTML?
How do I get the datables tbody through .innerHTML?
Description of problem:
I have a file called mastertable.js that handles the child relation between two datatables. For the child I want to be able to add hyperlinks to the elements of each row so I need to access the html of the tbody. However when I try to do this I can only see the header and thead of the table as well as an empty <tbody></tbody>. Strangely, if I print the table to the console, I can see the whole html including the tbody. How can I get the html of the datatable programmatically?
Answers
You could do
table.table().body().innerHTML
using thetable().body()
method - although I'm not clear on why you would need the raw HTML. Wouldn't you be better with the data?Allan