"Table fixed header (Simple)"
Bootstrap 3.0.0 Snippet by pradeep330

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.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"> <div class="col-md-6"> <div class="table-fixheader"> <div> <table class="table table-striped"> <thead> <tr> <th class="col-md-2">#</th> <th class="col-md-3">First Name</th> <th class="col-md-3">Last Name</th> <th class="col-md-4">Username</th> </tr> </thead> <tbody> <tr> <th class="col-md-2">1</th> <td class="col-md-3">Mark</td> <td class="col-md-3">Otto</td> <td class="col-md-4">@mdo</td> </tr> <tr> <th class="col-md-2">2</th> <td class="col-md-3">Jacob</td> <td class="col-md-3">Thornton</td> <td class="col-md-4">@fat</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> <tr> <th class="col-md-2">3</th> <td class="col-md-3">Larry</td> <td class="col-md-3">the Bird</td> <td class="col-md-4">@twitter</td> </tr> </tbody> </table> </div> </div> </div> </div> </div>
.table-fixheader { position: relative; padding-top: 40px; } .table-fixheader>div { height:150px; overflow-y:auto; } .table-fixheader thead{ position: absolute; width: 100%; top: 0; } .table-fixheader thead tr{ position: absolute; width: 100%; } .table-fixheader thead tr th{ display:inline-block; }

Related: See More


Questions / Comments: