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

后端 未结 10 2129
隐瞒了意图╮
隐瞒了意图╮ 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

    .contents {
      width: 50%;
      border: 1px solid black;
      height: 300px;
      overflow: auto;
    }
    
    table {
      position: relative;
    }
    
    th {
      position: sticky;
      top: 0;
      background: #ffffff;
    }
    
    
    colunn 1 colunn 2 colunn 3 colunn 4
    Example 1 Example 2 Example 3 Example 4
    Example 1 Example 2 Example 3 Example 4
    Example 1 Example 2 Example 3 Example 4
    Example 1 Example 2 Example 3 Example 4
    Example 1 Example 2 Example 3 Example 4
    Example 1 Example 2 Example 3 Example 4
    Example 1 Example 2 Example 3 Example 4
    Example 1 Example 2 Example 3 Example 4
    Example 1 Example 2 Example 3 Example 4
    Example 1 Example 2 Example 3 Example 4

提交回复
热议问题