I have a table with phone numbers and Forms and trying to add them all to 1 data object eg.
name: name
ph: [phone numbers]
Forms:[abForm]
but it is only giving me the last phone number and the last abForm of the table in the object.
// loop after 1st row
for (r = 1; r < rowcount; r++) {
cells = rows[r].cells;
// first column phonenumbers
cellcount = 1;
for (c = 0; c < cellcount; c++) {
tel = cells[c].innerText;
cellcount2 = 2;
}
// second column Forms
for (c = 0; c < cellcount2; c++) {
abForm = cells[c].innerText;
}
}
let phone = [tel];
var data = {
name: 'name',
ph: [phone],
Form: [abForm]
}
console.log(data)
// write out
}