-
Notifications
You must be signed in to change notification settings - Fork 297
/
bootstrap.html
94 lines (92 loc) · 3.03 KB
/
bootstrap.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<!--[if lt IE 8]><html lang="en" class="legacy"><![endif]-->
<!--[if gte IE 8]><!--><html lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Fixed Top Navbar Example for Bootstrap</title>
<link href="css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
min-height: 2000px;
padding-top: 70px;
}
.tableFloatingHeaderOriginal th {
background-color: #fff;
border-bottom: 1px solid #DDD;
}
</style>
</head>
<body>
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Twitter Bootstrap Demo</a>
</div>
<div class="navbar-collapse collapse">
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
<h1>Twitter Bootstrap Demo</h1>
<p>Note that in order to make the table header look ok when scrolling we need to add a background color and a bottom border.</p>
<p>There is also a bug in IE7 that causes the leftmost column to resize when scrolling. Consider using conditional comments (see source) to make sure the plugin is not loaded in this browser.
</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Label</th>
<th>Layout width</th>
<th>Column width</th>
<th>Gutter width</th>
</tr>
</thead>
<tbody>
<tr>
<td>Smartphones</td>
<td>480px and below</td>
<td class="muted" colspan="2">Fluid columns, no fixed widths</td>
</tr>
<tr>
<td>Smartphones to tablets</td>
<td>767px and below</td>
<td class="muted" colspan="2">Fluid columns, no fixed widths</td>
</tr>
<tr>
<td>Portrait tablets</td>
<td>768px and above</td>
<td>42px</td>
<td>20px</td>
</tr>
<tr>
<td>Default</td>
<td>980px and up</td>
<td>60px</td>
<td>20px</td>
</tr>
<tr>
<td>Large display</td>
<td>1200px and up</td>
<td>70px</td>
<td>30px</td>
</tr>
</tbody>
</table>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="../js/jquery.stickytableheaders.js"></script>
<script>
// adding filler rows
for(var i = 0; i < 3; i++){
$('tbody tr').clone().appendTo('table');
}
var offset = $('.navbar').height();
$("html:not(.legacy) table").stickyTableHeaders({fixedOffset: offset});
</script>
</body>
</html>