rows.add() spliting up my data
rows.add() spliting up my data
Andani
Posts: 1Questions: 0Answers: 0
Good Day
I am trying to add rows to datatable using jquery.
table.rows.add(['Andani']).draw();
The added string "Andani" is being split across for columns.
You will get the "A" in the first column, "n" in the second column, "d" in the third column, and so on an so on.
What could I be doing wrong?
This discussion has been closed.
Replies
Hi
When using
row.add()
expects either an object or array to be passed in so it can created the row with the data it has received, the data must match the number of columns in the table.So you could either pass in an array of data that matches the column count of your table such as (if your table has 6 columns)
or specify each column explicitly such as
If you want to add multiple rows at a time then you can also use
rows.add()
Thanks
Tom