gpt4 book ai didi

javascript - Bootstrap 固定表格单元格

转载 作者:行者123 更新时间:2023-11-28 13:14:29 27 4
gpt4 key购买 nike

如何使用 Bootstrap 制作一个固定的表格单元格,隐藏 bootstrap.overflow?我试过这个,但是数据垂直向下:

table {
table-layout: fixed;
}
table th,
table td {
overflow: hidden;
}

我有 10 列,样式如下:

<table class="table table-bordered">
<thead class="mbhead">
<tr class="mbrow">
<th style="width:10px"></th>
<th style="width:10%;">A</th>
<th style="width:10%;">B</th>
<th style="width:10%;">C</th>
<th style="width:10%;">D</th>
<th style="width:10%;">E</th>
<th style="width:10%;">F</th>
<th style="width:10%;">G</th>
<th style="width:10%;">H</th>
<th style="width:10%;">I</th>
<th style="width:10%;">J</th>
</tr>
</thead>
<tbody>
//other contents...
</body>
</table>

最佳答案

请检查这是否是您想要的。我用过div。让我知道是否有帮助。你可以看到我使用了 2 个 div。在第一个 div 中我设置溢出隐藏

<div  style="overflow: hidden; margin-left: 20px; height: 504px;">

在这个div里面我用了另一个div

 <div id="product"  style="overflow: auto;height: 350px;">

fiddle 的链接 here

关于javascript - Bootstrap 固定表格单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15153068/

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