forked from myliang/x-spreadsheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
61 lines (60 loc) · 1.63 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body onload="load()">
<div id="x-spreadsheet-demo"></div>
<script>
function load(){
// x.spreadsheet.locale('zh-cn');
var xs = x.spreadsheet('#x-spreadsheet-demo', {showToolbar: true, showGrid: true})
.loadData({
freeze: 'B3',
styles: [
{
bgcolor: '#f4f5f8',
textwrap: true,
color: '#900b09',
border: {
top: ['thin', '#0366d6'],
bottom: ['thin', '#0366d6'],
right: ['thin', '#0366d6'],
left: ['thin', '#0366d6'],
},
},
],
merges: [
'C3:D4',
],
rows: {
1: {
cells: {
0: { text: 'testingtesttestetst' },
2: { text: 'testing' },
},
},
2: {
cells: {
0: { text: 'render', style: 0 },
1: { text: 'Hello' },
2: { text: 'haha', merge: [1, 1] },
}
},
8: {
cells: {
8: { text: 'border test', style: 0 },
}
}
},
}).change((cdata) => {
console.log(cdata);
console.log(xs.validate());
});
}
</script>
<!--script type="text/javascript" src="https://unpkg.com/[email protected]/dist/locale/zh-cn.js"></script-->
</body>
</html>