-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfoldable-table.html
More file actions
66 lines (57 loc) · 2.27 KB
/
foldable-table.html
File metadata and controls
66 lines (57 loc) · 2.27 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Foldable Table Test</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="foldable-table.css" media="screen" />
<script src="https://code.jquery.com/jquery-1.12.4.js" integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU=" crossorigin="anonymous"></script>
<script src="foldable-table.js" charset="utf-8"></script>
<style type="text/css">
#foldable-table-example-1,
#foldable-table-example-2 {
padding: 1em 0 2em 4em;
max-width: 1200px;
}
</style>
</head>
<body>
<script charset="utf-8">
/* Example data */
const data = [
{ id: "foo-bee-laa" , url: "http://example.com/foo/bee/laa" , data: [120 , 235 , 482320 , ] } ,
{ id: "foo-bee-ooo" , url: "http://example.com/foo/bee/ooo" , data: [151 , 342 , 230215 , ] } ,
{ id: "foo-gee-sii" , url: "http://example.com/foo/gee/sii" , data: [25 , 35 , 302155 , ] } ,
{ id: "boo-zee-laa" , url: "http://example.com/boo/zee/laa" , data: [20 , 35 , 12600 , ] } ,
{ id: "boo-lee" , url: "http://example.com/boo/lee" , data: [8 , 12 , 94242 , ] } ,
{ id: "boo-lee-laa" , url: "http://example.com/boo/lee/laa" , data: [1 , 1 , 14900 , ] } ,
{ id: "boo-lee-laa-kii" , url: "http://example.com/boo/lee/laa/kii" , data: [1 , 1 , 14900 , ] } ,
];
/* Columns descriptions */
const headers = [
"good", "bad", "price"
];
const formatters = [
null, null, (n) => (Number(n) / 100).toFixed(2) + ' €'
];
$(() => {
$('#foldable-table-example-1').foldableTable({
data: data,
formatters: formatters,
});
$('#foldable-table-example-2').foldableTable({
data: data,
formatters: formatters,
headers: headers,
icons: true
});
$('#foldable-table-example-1').data("foldableTable").expandAll();
$('#foldable-table-example-2').data("foldableTable").expandAll();
});
</script>
<h1>First example, basic data</h1>
<div id="foldable-table-example-1"></div>
<h1>Second example, with title and headers</h1>
<div id="foldable-table-example-2" title="Example Title"></div>
</body>
</html>