-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.js
64 lines (54 loc) · 1.4 KB
/
init.js
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
// let a=10;
// script -> grid
let topRow = document.querySelector(".top-row");
let str = "";
for (let i = 0; i < 26; i++) {
str += `<div class='col'>${String.fromCharCode(65 + i)}</div>`;
}
topRow.innerHTML = str;
let leftCol = document.querySelector(".left-col");
str = ""
for (let i = 0; i < 100; i++) {
str += `<div class='left-col_box'>${i + 1}</div>`
}
leftCol.innerHTML = str;
// 2d array
let grid = document.querySelector(".grid");
str = "";
for (let i = 0; i < 100; i++) {
str += `<div class="row">`
for (let j = 0; j < 26; j++) {
str += `<div class='col' rid=${i} cid=${j} contenteditable="true"></div>`
}
str += "</div>";
}
grid.innerHTML = str;
// initial load
let workSheetDB = [];
function initCurrentSheetDb() {
let sheetDB = [];
for (let i = 0; i < 100; i++) {
let row = [];
for (let j = 0; j < 26; j++) {
let cell = {
bold: false,
italic: "normal",
underline: "none",
fontFamily: "Arial",
fontSize: "10",
halign: "left",
value: "",
children: [],
formula: ""
}
row.push(cell);
}
sheetDB.push(row);
}
console.log(sheetDB);
workSheetDB.push(sheetDB);
console.log(workSheetDB);
}
initCurrentSheetDb();
// 2 d Array-> styling prop
// cell set