Skip to content

Instantly share code, notes, and snippets.

@mfd
Last active April 9, 2019 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfd/a40f046166e0d0efee0411cb83f26508 to your computer and use it in GitHub Desktop.
Save mfd/a40f046166e0d0efee0411cb83f26508 to your computer and use it in GitHub Desktop.
Таблица умножения
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