Compare commits

..

2 Commits

View File

@ -99,6 +99,19 @@ function make_table(url) {
"Venerdì", "Venerdì",
"Sabato", "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) => { week.forEach((weekday) => {
let tr = document.createElement("tr"); let tr = document.createElement("tr");
let th = document.createElement("th"); let th = document.createElement("th");
@ -109,7 +122,7 @@ function make_table(url) {
let inserted = 0; let inserted = 0;
data[weekday].forEach((student_class) => { data[weekday].forEach((student_class) => {
let td = document.createElement("td"); let td = document.createElement("td");
td.textContent = student_class; td.textContent = student_class.replace(/ (?=[a-z])/g, "");
tr.appendChild(td); tr.appendChild(td);
inserted++; inserted++;
}); });