I've been trying to get this data, but the array comes out empty:
function saveData() {
var tableData = [];
var table = document.getElementById("dtable");
console.log(table)
for (var i = 0; i < table.length; i++) {
let tableCells = table.rows.item(i).cells;
let cellLength = tableCells.length;
for (let j = 0; j < cellLength; j++) {
let cellVal = tableCells.item(j).innerHTML;
tableData.push(cellVal)
}
}
console.log(tableData)
rows = JSON.stringify(tableData);
google.script.run.formToSheets(rows);
}
