From 6c998c10c74662b6e6f385b7afe0fc10d0e95677 Mon Sep 17 00:00:00 2001 From: Mariano Riefolo Date: Thu, 5 Sep 2024 15:26:59 +0200 Subject: [PATCH] feat(frontend): add table head --- static/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/static/index.js b/static/index.js index ca4bbf4..c7cea0d 100644 --- a/static/index.js +++ b/static/index.js @@ -99,6 +99,19 @@ function make_table(url) { "Venerdì", "Sabato", ]; + let thead = document.createElement("thead"); + let tr = document.createElement("tr"); + let th = document.createElement("th"); + th.scope = "col"; + tr.appendChild(th); + for (let i = 0; i < columns; i++) { + let th = document.createElement("th"); + th.scope = "col"; + th.textContent = i + 1; + tr.appendChild(th); + } + thead.appendChild(tr); + table.appendChild(thead); week.forEach((weekday) => { let tr = document.createElement("tr"); let th = document.createElement("th");