Table fixed header and scrollable body

前端 未结 29 1734
粉色の甜心
粉色の甜心 2020-11-22 05:33

I am trying to make a table with fixed header and a scrollable content using the bootstrap 3 table. Unfortunately the solutions I have found does not work with bootstrap or

29条回答
  •  臣服心动
    2020-11-22 06:06

    Don't need the wrap it in a div...

    CSS:

    tr {
    width: 100%;
    display: inline-table;
    table-layout: fixed;
    }
    
    table{
     height:300px;              // <-- Select the height of the table
     display: -moz-groupbox;    // Firefox Bad Effect
    }
    tbody{
      overflow-y: scroll;      
      height: 200px;            //  <-- Select the height of the body
      width: 100%;
      position: absolute;
    }
    

    Bootply : http://www.bootply.com/AgI8LpDugl

提交回复
热议问题