Is there a way to add table rows with html?
Is there a way to add table rows with html?
Here is demo of simple row add function. When you click the "Add Rows" button it uses row().data() to copy the data from each row and then uses the row.add(data) to add new rows. But any formatting from the copied rows, like background color, is lost. Is there a similarly simple way to copy rows with the html intact and then add rows back in with html? Something like row().html() and row.add(html)? Thanks in advance, as always. c
This discussion has been closed.
Replies
row.add()
can also take a node, so you can clone the existing nodes in the table and pass that in. See your example updated here: http://live.datatables.net/cuqofuco/1/editColin
Beautiful. Thank you Colin.
Here's updated demo.
Stay well!
c
I would like to know more about how to add table rows with HTML. Thank you!
What would you like to know that isn't shown in the demos / examples linked to above?
Allan