gpt4 book ai didi

css - bootstrap 表头固定问题

转载 作者:行者123 更新时间:2023-11-28 11:26:45 26 4
gpt4 key购买 nike

我正在使用bootstrap。我正在尝试使用固定的表格标题,但它没有固定,可以滚动。我不想滚动表头,我想要一个固定的表头。请帮助我修复它。

这是我的代码示例:

这是我的代码:

  <div class="widget-content">
<div class="container">
<table class="table table-bordered">
<thead>
<th class="text-center"> my</th>
<th class="text-center"> text / line</th>
<th class="text-center">caps/ lock</th>
<th class="text-center">Value</th>
<th class="text-center">Qty</th>
<th class="text-center">other</th>
</thead>
<tbody>

<tr class="dt-picked">
<td class="text-center">
<span style="color:white; font-weight:bold;"> text</span>

</td>
<td class="text-center">
<p>text</p>

</td>
<td class="text-center ">
<p>text</p>
<p>text</p>
</td>
<td class="text-center"> <p>text</p></td>
<td class="text-center b-color-1"><p>text</p></td>
<td>
class="btn btn-mini btn-danger" role="button">Sell</a>
</td>
</tr>

<tr>
<td colspan="4" class="text-right no-stripe">Total Cash</td>
<td class="b-color-1"><p>text</p></td>
</tr>
<tr>
<td colspan="4" class="text-right no-stripe">Total Invested</td>
<td class="b-color-1"><p>text</p></td>
<td colspan="2" class="no-stripe"></td>
</tr>
<tr>
<td colspan="4" class="text-right bold no-stripe">Bottom Line</td>
<td class="b-color-1 bold"><p>text</p></td>
<td colspan="2" class="no-stripe"></td>
</tr>
</tbody>
</table>
</div>
</div>

最佳答案

我有一把 fiddle 送给你

<thead>
<tr class="header">
<th>
Table attribute name
<div>Table attribute name</div>
</th>
<th>
Value
<div>Value</div>
</th>
<th>
Description
<div>Description</div>
</th>
</tr>
</thead>

https://jsfiddle.net/byB9d/14995/

关于css - bootstrap 表头固定问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45407234/

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