I have used https://datatables.net/reference/api/rows.add%28%29 link working but the data showing the table as [object,object]
. How to show the object to string. i have used JSON.stringify(obj)
its also not working.
HTML
<table id="exampleTable">
<thead>
<tr>
<th>Year</th>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>2012</td>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>2012</td>
<td>February</td>
<td>$80</td>
</tr>
</table>
JS
$('#addRows').click();
var table3 = $('#exampleTable').DataTable();
$('#addRows').on( 'click', function () {
table3.row.add(
[ { "Year": "Tiger Nixon", "Month": "System Architect", "Savings": "$3,120" },
{"Year": "Tiger Nixon", "Month": "System Architect", "Savings": "$3,120" }]
).draw();
});