-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
76 lines (65 loc) · 1.84 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html>
<head>
<style>
.grid-container {
display: grid;
grid-template-columns: auto auto auto auto auto auto auto auto auto ;
gap: 0px;
background-color: #2196F3;
padding: 2px;
}
.grid-container>div {
background-color: rgba(255, 255, 255, 0.8);
text-align: center;
padding: 20px;
font-size: 25px;
border-top: 1px solid #000;
border-left: 1px solid #000;
}
.grid-c{
border-right: 2px solid #000;
border-left: 2px solid #000;
}
.grid-r{
border-top: 2px solid #000;
border-bottom: 2px solid #000;
}
</style>
<script>
window.onload = function () {
genSudokuGrid();
};
function genSudokuGrid(){
var html = "";
for (var i = 1; i < 10; i++) {
for (var j = 1; j < 10; j++) {
var n = (i-1)*9 +j;
var c = ''
if(i%3==0){
c += ' grid-r'
}
if(j%3==0){
c += ' grid-c'
}
html += '<div class="'+c+'" id="item_' + i + '_'+ j+ '">' + i + ',' + j + '</div>';
}
}
//console.log(html);
document.getElementById('table').innerHTML = html;
};
function fillSudokuTable(){
for (var i = 1; i < 10; i++) {
for (var j = 1; j < 10; j++) {
}
}
}
</script>
</head>
<body>
<h1>Grid Lines</h1>
<div class="grid-container" id="table">
</div>
<p>You can refer to line numbers when placing grid items.</p>
</body>
</html>