for (const table of document.querySelectorAll('table')) {
const labels = Array.from(table.tHead.rows[0].cells, n => n.textContent);
for (const tbody of table.tBodies) {
for (const tr of tbody.rows) {
for (let i = 0; i < tr.cells.length; i++) {
tr.cells[i].dataset.label = labels[i];
}
}
}
}