I won’t say much about other knowledge about bootstrap table, I will just post code to you.
The key code is as follows:
<!DOCTYPE html> <html> <head> <title></title> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> <script type="text/javascript" src="js/bootstrap.min.js"></script> <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script> <script src="iscroll.js"></script> </head> <body> <div id="con"> <div id="2"> <table> <thead style="display:block;overflow-y: scroll;border-bottom:1px solid #eee;"> <tr> <th>Column 1</th> <th>Column 2</th> <th>Column 1</th> <th>Column 1</th> <th>Column 1</th> <th>Column 1</th> <th>Column 2</th> <th>Column 2</th> <th>Column 3</th> </tr> </thead> <tbody style="display:block; max-height:200px;overflow-y: scroll;"> <tr> <td>Monday</td> <td>Tuesday</td> <td>Tuesday</td> <td>Wednesday</td> </tr> <tr> <td>Monday</td> <td>Tuesday</td> <td>Wednesday</td> <td>Monday</td> <td>Tuesday</td> <td>Tuesday</td> <td>Tuesday</td> </tr> <tr> <td>Monday</td> <td>Tuesday</td> <td>Tuesday</td> <td>Tuesday</td> <td>Tuesday</td> <td> <td>Monday</td> <td>Tues</td> <td>Wednesday</td> <td>Monday</td> <td>Tues</td> <td>Tues</td> <td>Wednesday</td> </tr> <tr> <td>Monday</td> <td>Tues</td> <td>Monday</td> <td>Monday</td> <td>Monday</td> <td>Monday</td> <td>Tues</td> <td>Monday</td> <td>Tues</td> <td>Monday</td> <td>Tues</td> <td>Monday</td> <td>Tues</td> <td>Tues</td> <td>Tues</td> <td>Monday</td> <td>Tues</td> <td>Tues</td> <td>Monday</td> <td>Tues</td> <td>Tues</td> <td>Wednesday</td> <td>Monday</td> <td>Tuesday</td> <td>Wednesday</td> </td> </tbody> </table> </div> </body> <script type="text/javascript"> $(document).ready(function(){ var _width=$('#2').width(); $('#2 th:first-child').width(_width*0.1); $('#2 td:first-child').width(_width*0.1); $('#2 th:nth-child(2)').width(_width*0.2); $('#2 td:nth-child(2)').width(_width*0.2); $('#2 th:nth-child(3)').width(_width*0.3); $('#2 td:nth-child(3)').width(_width*0.3); $('#2 td:nth-child(3)').width(_width*0.3); $('#2 td:nth-child(4)').width(_width*0.1); $('#2 td:nth-child(5)').width(_width*0.1); $('#2 td:nth-child(5)').width(_width*0.1); $('#2 td:nth-child(5)').width(_width*0.1); $('#2 th:nth-child(6)').width(_width*0.2); $('#2 td:nth-child(6)').width(_width*0.2); }) </script> </html>The above is the example code of the BootStrap table header fixed tbody scrolling introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!