How to stick table header(thead) on top while scrolling down the table rows with fixed header(navbar) in bootstrap 3?

后端 未结 10 2118
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 03:04

Bootstrap layout with fixed-navbar. Having table with so many rows in body.

Issue? As i scroll the page navigation-bar will be there be

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 03:58

    Use: https://github.com/mkoryak/floatThead

    Docs: http://mkoryak.github.io/floatThead/examples/bootstrap3/

    $(document).ready(function(){
      $(".sticky-header").floatThead({top:50});
    });
    

    DEMO with 2 Tables and Fixed Header: http://jsbin.com/zuzuqe/1/

    http://jsbin.com/zuzuqe/1/edit


    HTML

    
    
    
    
    

    Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within #wrap with padding-top: 60px; on the .container.

    Table 2


    CSS

    body{
      padding-top:50px;
    }
    table.floatThead-table {
      border-top: none;
      border-bottom: none;
      background-color: #fff;
    }
    

提交回复
热议问题