I need to take table rows and convert to JSON.
Any ideas? I have this code here but it does not work.
function tableToJSON(tableID) {
return $(t
HTML table with thead and tbody:
function htmlTableToJson(table, edit = 0, del = 0) {
// If exists the cols: "edit" and "del" to remove from JSON just pass values = 1 to edit and del params
var minus = edit + del;
var data = [];
var colsLength = $(table.find('thead tr')[0]).find('th').length - minus;
var rowsLength = $(table.find('tbody tr')).length;
// first row needs to be headers
var headers = [];
for (var i=0; i