From 1e8ae0105af5bd3bc36a892d22475ba3e36caf0e Mon Sep 17 00:00:00 2001 From: moerp Date: Tue, 30 Jan 2024 19:38:49 +0100 Subject: [PATCH] to many row --- src/templates/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/templates/index.html b/src/templates/index.html index 661f239..ad55e19 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -154,12 +154,12 @@ function updateTotalNutrition() { // Durchlaufen aller Zeilen in der Haupttabelle und Addition der Werte Array.from(document.getElementById('nutrition-table').rows).slice(1).forEach(row => { - totalKcal += parseFloat(row.cells[4].innerText); - totalEw += parseFloat(row.cells[4].innerText); - totalFett += parseFloat(row.cells[5].innerText); - totalKh += parseFloat(row.cells[6].innerText); - totalBst += parseFloat(row.cells[7].innerText); - totalCa += parseFloat(row.cells[8].innerText); + totalKcal += parseFloat(row.cells[2].innerText); + totalEw += parseFloat(row.cells[3].innerText); + totalFett += parseFloat(row.cells[4].innerText); + totalKh += parseFloat(row.cells[5].innerText); + totalBst += parseFloat(row.cells[6].innerText); + totalCa += parseFloat(row.cells[7].innerText); }); // Rundung und Aktualisierung der Gesamtwerte