Generate the row at the top of the table.
Generate the row at the top of the table.

How to use the addRow() method to generate a new row at the top of the table. By default the row appends with the table. I need to prepend it.
Thanks in advance
This discussion has been closed.
Answers
doesn't it depend on the sort order of the table ?
You could order by eg ID 'desc' by default so any new rows would appear at the top
What is the
addRow()
method?As @crush123 says ordering in DataTables is defined entirely by the ordering applied to the table. So if you want a row to appear at the top, make sure it comes first in the applied ordering!
Allan