Skip to content

Instantly share code, notes, and snippets.

@mfd mfd/script.js
Last active Apr 9, 2019

Embed
What would you like to do?
Таблица умножения
var data = [];
for(let i = 1; i < 10; i++) {
data[i] = []
for(let j = 1; j < 10; j++) {
data[i].push(i*j);
}
}
console.table(data)
var html = '<table>';
for (row in data) {
html += `<tr>`;
for (item in data[row]) {
html += `<td>${data[row][item]}</td>`;
}
html += `</tr>`
}
html += '</table>';
document.body.innerHTML = html;
body
font-family: sans-serif
table
border-collapse: collapse
td
text-align: right
padding: .5em
// Cross Hover
//
table
overflow: hidden
td, th
position: relative
outline: 0
body:not(.nohover) tbody tr:hover
background-color: #ffa
td:hover::after, thead th:not(:empty):hover::after, td:focus::after, thead th:not(:empty):focus::after
content: ''
height: 10000px
left: 0
position: absolute
top: -5000px
width: 100%
z-index: -1
td:hover::after, th:hover::after
background-color: #ffa
td:focus::after, th:focus::after
background-color: lightblue
tr:not(:first-child)
td:not(:first-child):hover
color: green
font-weight: bold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.