|
@@ -37,3 +37,43 @@ fetch('https://raw.githubusercontent.com/russ666/all-countries-and-cities-json/m
|
|
|
|
|
|
//tableMouseTask
|
|
//tableMouseTask
|
|
|
|
|
|
|
|
+let table = document.createElement('table');
|
|
|
|
+document.body.appendChild(table)
|
|
|
|
+table.style.marginTop = '100px'
|
|
|
|
+
|
|
|
|
+for (let i = 0; i <= 9; i++){
|
|
|
|
+ let tr = document.createElement('tr');
|
|
|
|
+
|
|
|
|
+ for (let j = 0; j <= 9; j++){
|
|
|
|
+ let td = document.createElement('td');
|
|
|
|
+ td.style.padding = "5px";
|
|
|
|
+ td.style.border = "2px solid black";
|
|
|
|
+ if(i === 0) td.innerText = j;
|
|
|
|
+ else if(j === 0) td.innerText = i;
|
|
|
|
+ else td.innerHTML = i*j;
|
|
|
|
+ tr.appendChild(td);
|
|
|
|
+
|
|
|
|
+ td.onmouseover = function (event) {
|
|
|
|
+ for (let i = 0; i < table.children.length; i++) {
|
|
|
|
+ table.children[i].children[j].style.background = "lightgreen";
|
|
|
|
+ }
|
|
|
|
+ tr.style.background = "lightgreen"
|
|
|
|
+ td.style.background = "lightgreen"
|
|
|
|
+ td.style.boxShadow = "0px 5px 10px 2px rgba(34, 60, 80, 1)"
|
|
|
|
+ tr.style.boxShadow = "0px 5px 10px 2px rgba(34, 60, 80, 1)"
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ td.onmouseout = function (event) {
|
|
|
|
+ for (let i = 0; i < table.children.length; i++) {
|
|
|
|
+ table.children[i].children[j].style.background = "";
|
|
|
|
+ }
|
|
|
|
+ tr.style.background = ""
|
|
|
|
+ td.style.background = ""
|
|
|
|
+ td.style.boxShadow = ""
|
|
|
|
+ tr.style.boxShadow = ""
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ table.appendChild(tr);
|
|
|
|
+}
|
|
|
|
+document.body.appendChild(table);
|
|
|
|
+
|