Compare commits

...

2 Commits

View File

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