legacy site deprication

This commit is contained in:
=
2026-03-27 14:30:00 +10:00
parent 2869d51a52
commit b5760c5b3f
55 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// создание таблицы
const showTable = (idTable, data) => {
const table = d3.select("#" + idTable);
// создание строк таблицы (столько, сколько элементов в массиве)
const rows = table
.selectAll("tr")
.data(data)
.enter()
.append('tr')
.style("display", "");
// создание ячеек каждой строки на основе каждого элемента массива
const cells = rows
.selectAll("td")
.data(d => Object.values(d))
.enter()
.append("td")
.text(d => d);
// создание шапки таблицы
const head = table
.insert("tr", "tr")
.selectAll("th")
.data(d => Object.keys(data[0]))
.enter()
.append("th")
.text(d => d);
}
const clearTable = (idTable) => {
const table = document.getElementById(idTable);
while (table.children.length > 0) {
table.removeChild(table.children[0]);
}
}