-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathduckDivisionsWebsiteTable.html
68 lines (55 loc) · 2.44 KB
/
duckDivisionsWebsiteTable.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
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<link href="https://unpkg.com/tabulator-tables@5.2.3/dist/css/tabulator_modern.min.css" rel="stylesheet">
<style>
body{
background-color:#fff;
}
</style>
<body>
<div id="data-table"></div>
<div id="alerts"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/luxon/2.4.0/luxon.min.js" integrity="sha512-v1zUTZ9zv9Wb2scL/ANxXM6m7yegm/W5SN8SRHNFADdZIuSFFkrEBjNxO803DdFkjoCcJ88g1WHRVlLN6K/O1A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/luxon/2.4.0/luxon.js" integrity="sha512-mG5s2PtixGEVGHGdHEP/t09HMp5LS4O7tGSveeGniCbzeZKIxsPdmExeabz8xmxcSe+wfYvSMbe6G2c3d9ZQXQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@5.2.3/dist/js/tabulator.min.js"></script>
<script>
// http://tabulator.info/
const elements = {}
document.addEventListener("DOMContentLoaded",pageLoad)
function pageLoad(){
elements.alerts = document.getElementById("alerts")
loadData()
}
function loadData(){
google.script.run
.withSuccessHandler((jsData) => {
const table = new Tabulator("#data-table", {
// if data successfully
data:jsData, //assign data to table
layout:"fitColumns", //fit columns to width of table (optional)
pagination:true,
paginationSize:10,
columnDefaults:{
hozAlign:"center",
headerHozAlign:"center",
headerSort:true
},
columns:[ //Define Table Columns
{title:"Presence (Pick + Ban%)", field:"Presence (Pick + Ban%)", width:250},
{title:"Champion", field:"Champion", headerSort:false, width:200, headerFilter:true, },
{title:"# Picks", field:"# Picks", width:100},
{title:"# Bans", field:"# Bans", width:100},
{title:"Win Rate", field:"Win Rate", width:200},
{title:"Average KDA", field:"Average KDA", width:250},
],
})
})// end of SuccessHandler for jsData
.withFailureHandler((er) => {
})// end of SuccessHandler for jsData
.getData()
}
</script>
</body>
</html>