-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleaderboard.html
54 lines (53 loc) · 2.18 KB
/
leaderboard.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Leaderboard</title>
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-32x32.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/dashboard.css">
</head>
<body style="background-color: #B0BEC5">
<div>
<p align="center" style="font-size: 35px;font-family: 'Bookman Old Style';margin-left: 5%">LeaderBoard</p>
<div class="container-fluid" style="padding-bottom: 0px;margin-bottom: 0px;">
<div class="row" style="margin-left: 20%">
<div class="col-sm-10" style="padding: 10px;">
<div class="table-responsive" style="box-shadow: 0px 8px 16px 4px rgba(0,0,0,0.2);border-radius: 5px;">
<table id="myTable" class=" col-sm-8 table text-center " style="padding: 0px;background: #FFF;margin: 0px;" data-min="5" data-max="50">
<thead class="text-center">
<tr style="background: #546E7A;color: #FFF;">
<th style="text-align: center;">Rank</th>
<th style="text-align: center;">Name</th>
<th style="text-align: center;">Balance</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
$.getJSON("https://mockstockapi.udaan18.com:8000/leaderboard", function (data) {
var list=data["message"];
var t = document.getElementById('myTable');
var row,cell1,cell2,cell3
for(var i=list.length;i>0;i--){
row = t.insertRow(1);
cell1 = row.insertCell(0);
cell2 = row.insertCell(1);
cell3 = row.insertCell(2);
cell1.innerHTML=list[i-1]["rank"];
cell2.innerHTML=list[i-1]["name"];
cell3.innerHTML=list[i-1]["balance"];
}
})
</script>
</body>
</html>