gpt4 book ai didi

javascript - Jquery 表 : customize seanmacisaac table/insert tbody into div

转载 作者:太空宇宙 更新时间:2023-11-04 12:39:01 25 4
gpt4 key购买 nike

我正在尝试调整由 seanmacisaac 设置的 Jquery 可排序、可搜索表引用:http://www.seanjmacisaac.com/projects/code/tablesort/#index-member-4

如何将 tbody 高度设置为固定值。还允许垂直滚动(溢出-y)?

<table class="table-sort table-sort-search table-sort-show-search-count">

<thead>
<tr><th class="table-sort">head1</th><th class="table-sort">head2</th><th class="table-sort">head3</th></tr>
</thead>

<tbody>
<tr><td>1-1</td><td>1-2</td><td>1-3</td></tr>
<tr><td>2-1</td><td>2-2</td><td>2-3</td></tr>
<tr><td>3-1</td><td>3-2</td><td>3-3</td></tr>
<tr><td>4-1</td><td>4-2</td><td>4-3</td></tr>
</tbody>
</table>

最佳答案

只需将表格包裹到一个 div 中即可:

<div style="overflow:auto;height:500px;width:100%">
<table></table> // with any number of row
</div>

把css放到一个class中,在容器div中添加一个class

关于javascript - Jquery 表 : customize seanmacisaac table/insert tbody into div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27039817/

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