How to create other table from datatable

How to create other table from datatable

Lucaslopez12Lucaslopez12 Posts: 14Questions: 6Answers: 0

Hi.

I am trying to create a datatable from the data of another table.

Until now I managed to capture the data of a column and save it in a variable or show it in the console with

`$('#sellersQuantityTable tbody').on('click', 'tr', function () {
var dataNew = table.row( this ).data();

var table2 = $('#example2').DataTable();
 console.log(dataNew)
table2.clear();
table2.row.add( dataNew ).draw();

} );`

I try create a new table with datanew but I can't get it to render in the DOM.

This is what I want to achieve.

I also tried to create the new table with INNETHTML and call it when clicking on a td but it doesn't show me.

If someone had something like this created, it would serve as an example to me since I don't know how else to do it.

Thanks!

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.