Closed alexander26k closed 7 years ago
I am not able to help without knowing what the HTML of the table looks like. Please share an example, it would be even more helpful if you put it on Plunker: http://plnkr.co/edit/iQFtcEEZkvsMJ2UqcrlW?p=preview
I create an example. Please see http://plnkr.co/edit/5SU9isbYSnlq5N4okEwz?p=preview
tableToJson only works with a single table, you cannot use it on multiple tables by making a generalized selector.
If you want table toJson to work on all the tables, you have to call it on each table and join the results:
var entireTable = [];
var table1 = $('#tReports1').tableToJSON();
var table2 = $('#tReports2').tableToJSON();
var table3 = $('#tReports3').tableToJSON();
entireTable = entireTable.concat(table1);
entireTable = entireTable.concat(table2);
entireTable = entireTable.concat(table3);
Hello. I have any table on page. Calling a function like this: var table = $('.report').tableToJSON(); but there are some problems. The script reads the header only the first table, and on it already puts the data. How to make that code takes into account the headers of each table? thanks in advance