|
@@ -82,7 +82,6 @@ function geomProgressionCalc(min, max, step){
|
|
|
|
|
|
console.log(geomProgressionCalc(10, 20, 2))
|
|
console.log(geomProgressionCalc(10, 20, 2))
|
|
|
|
|
|
-
|
|
|
|
//HTML TREE RECURSION
|
|
//HTML TREE RECURSION
|
|
let $table = document.createElement('table');
|
|
let $table = document.createElement('table');
|
|
|
|
|
|
@@ -90,7 +89,7 @@ function rerenderColor(e, color) {
|
|
Array.from($table.children).map(item => {
|
|
Array.from($table.children).map(item => {
|
|
Array.from(item.children).filter(item => item.cellIndex === e.target.cellIndex).map(item => item.style.backgroundColor = color)
|
|
Array.from(item.children).filter(item => item.cellIndex === e.target.cellIndex).map(item => item.style.backgroundColor = color)
|
|
})
|
|
})
|
|
-}
|
|
|
|
|
|
+};
|
|
|
|
|
|
let i = 10;
|
|
let i = 10;
|
|
function createRow() {
|
|
function createRow() {
|
|
@@ -100,7 +99,7 @@ function createRow() {
|
|
let j = 1;
|
|
let j = 1;
|
|
function createCell() {
|
|
function createCell() {
|
|
j++
|
|
j++
|
|
- let $td = document.createElement('td')
|
|
|
|
|
|
+ let $td = document.createElement('td');
|
|
$td.innerText = String(j * i)
|
|
$td.innerText = String(j * i)
|
|
$td.addEventListener('mouseover', (e) => {
|
|
$td.addEventListener('mouseover', (e) => {
|
|
rerenderColor(e, 'red')
|
|
rerenderColor(e, 'red')
|
|
@@ -110,10 +109,10 @@ function createRow() {
|
|
$tr.appendChild($td)
|
|
$tr.appendChild($td)
|
|
if(j < 9) createCell()
|
|
if(j < 9) createCell()
|
|
}
|
|
}
|
|
- $table.appendChild($tr);
|
|
|
|
|
|
+ $table.appendChild($tr)
|
|
createCell()
|
|
createCell()
|
|
if(i > 1) createRow();
|
|
if(i > 1) createRow();
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
createRow()
|
|
createRow()
|
|
-document.body.appendChild($table)
|
|
|
|
|
|
+document.body.appendChild($table);
|