gpt4 book ai didi

css - Bootstrap 表固定 header 不起作用

转载 作者:行者123 更新时间:2023-11-28 08:36:18 25 4
gpt4 key购买 nike

我已经使用 bootstrap-table 在我的元素中设置了一个表。除了 tbody 内的滚动条外,一切正常。

那里没有滚动条。我错过了什么?我相信如果滚动条可见,那么表格功能的 fixed-header 也应该可以正常工作。

<table id="tblMain" class="table table-bordered table-hover" data-show-refresh="false" data-click-to-select="false" data-single-select="true" data-show-toggle="false" data-show-columns="false" data-cache="false" data-page-number="@Model.CommonVariable" data-url='@Url.Action("Index", "Home")'  data-side-pagination="server" data-pagination="true" data-search="false" data-query-params="queryParams" data-response-handler="respHandler">
<thead class="table-head">
<tr>
<th data-field="id" data-formatter="SomeFunction">Item ID</th>
<th data-field="name" data-formatter="SomeFunction2">Item Name</th>
<th data-field="price" data-formatter="SomeFunction3">Item Price</th>
</tr>
</thead>
</table>

最佳答案

看看这个 fiddle ...

这不是我创建的,但我认为这是您正在寻找的。

    table {
table-layout:fixed;
}

.div-table-content {
height:150px;
overflow-y:auto;
}

关于css - Bootstrap 表固定 header 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29781585/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com