<tr>
<td><input data-id="r1c1" data-class="c1" value="101" disabled></td>
<td><input data-id="r1c2" data-class="c2"></td>
<td><input data-id="r1c3" data-class="c3"></td>
<td><input data-id="r1c4" data-class="c4"></td>
<td><input data-id="r1c5" data-class="c5"></td>
<td><input data-id="r1c6" data-class="c6"></td>
<td><input data-id="r1c7" data-class="c7"></td>
</tr>
<tr>
<td><input data-id="r2c1" data-class="c1" value="102" disabled></td>
<td><input data-id="r2c2" data-class="c2" value="21"></td>
<td><input data-id="r2c3" data-class="c3" value="22"></td>
<td><input data-id="r2c4" data-class="c4" value="23"></td>
<td><input data-id="r2c5" data-class="c5" value="24"></td>
<td><input data-id="r2c6" data-class="c6" value="25"></td>
<td><input data-id="r2c7" data-class="c7" value="26"></td>
</tr>
tbody
у таблицы? Один штука:document.querySelector('tbody').addEventListener('input', function() {
const data = Array.from(
this.children,
tr => Array.from(tr.querySelectorAll('input'), input => input.value)
);
console.log(data);
});
document.querySelector('table').addEventListener('input', e => {
const { map, flatMap } = Array.prototype;
const data = flatMap.call(
table.tBodies,
tbody => map.call(
tbody.rows,
tr => map.call(tr.cells, td => td.querySelector('input').value)
)
);
console.log(data);
});
var data = []
function change(node){
let [ row, col ] = node.dataset.id.substring(1,).split('c').map(v => --v);
if (!data[row]) data[row] = [];
if (node.value) data[row][col] = +node.value;
}
document.querySelectorAll('input').forEach( node => {
change(node);
node.addEventListener('change', e => change(e.target));
});