table to array
function tableToArray (table) { var rows = table.rows; var cols = table.rows[0].cells.length; var rowArray = []; var rowData = []; var cellData = []; for (var i = 0; i < rows.length; i++) { rowData = []; for (var j = 0; j < cols; j++) { rowData.push(rows[i].cells[j].innerHTML); } rowArray.push(rowData); } return rowArray; }