bootstrap表头固定

原文地址:http://coding.cuikangjie.com/content/25/bootstrap%20%E8%A1%A8%E5%A4%B4%E5%9B%BA%E5%AE%9A

css:

//表头固定

.fixed_headers thead tr {

    display: block;
    position: relative;
}
.fixed_headers tbody {
    display: block;
    overflow: auto;
    height: 250px;
}
//每列宽度

.fixed_headers td:nth-child(1),
.fixed_headers th:nth-child(1) {

    min-width: 250px;
    text-overflow:ellipsis;
    white-space:nowrap;
    overflow:hidden;
}
.fixed_headers td:nth-child(2),
.fixed_headers th:nth-child(2) {
    min-width: 200px;
}
.fixed_headers td:nth-child(3),
.fixed_headers th:nth-child(3) {
    min-width: 200px;
}
.fixed_headers td:nth-child(4),
.fixed_headers th:nth-child(4) {
    min-width: 200px;
}
.fixed_headers td:nth-child(5),
.fixed_headers th:nth-child(5) {
    min-width: 200px;
}
.fixed_headers td:nth-child(6),
.fixed_headers th:nth-child(6) {
    min-width: 200px;
}
.fixed_headers td:nth-child(7),
.fixed_headers th:nth-child(7) {
    min-width: 200px;
}
.fixed_headers td:nth-child(8),
.fixed_headers th:nth-child(8) {
    min-width: 200px;
}

  


html:
<table class="table  table-hover coma-base-table fixed_headers">
    <thead>
    <tr style="white-space: nowrap">
        <th  style="font-weight: bold;">被参控公司</th>
        <th  style="font-weight: bold;">参控关系</th>
        <th  style="font-weight: bold;">直接持股比例</th>
    </tr>
    </thead>
    <tbody>
         ..........
    </tbody>
</table>

  

 
 
 


 

转载于:https://www.cnblogs.com/kin-jie/p/5939630.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值