"Table fixed row header"
Bootstrap 3.3.0 Snippet by vira1368

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
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<h2>Table fixed row header</h2>
</div>
<table class="table table-fixed table-striped">
<thead>
<tr>
<th>Row</th>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
<th>City</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Amin</td>
<td>Saffarnejad</td>
<td>27</td>
<td>Ahvaz</td>
</tr>
<tr>
<td>2</td>
<td>Hassan</td>
<td>Faghihi</td>
<td>28</td>
<td>Khur</td>
</tr>
<tr>
<td>3</td>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
table {
width: 50%;
}
thead, tbody, tr, td, th {
display: block;
}
thead th {
height: 30px;
}
tbody {
overflow-y: auto;
height: 150px;
}
tbody td, thead th {
float: left;
width: 20%;
}
tr:after {
clear: both;
content: ' ';
display: block;
visibility: hidden;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: