【问题标题】:jquery tablesorter vertical scroll not workingjquery tablesorter垂直滚动不起作用
【发布时间】:2016-12-20 07:07:49
【问题描述】:

我在我的应用程序中使用 jquery tablesorter 表。我想为 tbody 和 overflow-y 滚动添加最大高度。

<table id="myTable" class="tablesorter"> 
<thead> 
<tr> 
    <th>Last Name</th> 
    <th>First Name</th> 
    <th>Email</th> 
    <th>Due</th> 
    <th>Web Site</th> 
</tr> 
</thead> 
<tbody> 
<tr> 
    <td>Smith</td> 
    <td>John</td> 
    <td>jsmith@gmail.com</td> 
    <td>$50.00</td> 
    <td>http://www.jsmith.com</td> 
</tr> 

</tbody> 
</table> 

我加了

.tablesorter thead{
display:block;
}
.tablesorter tbody{
    height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    display: block ;
}

但它没有采取...有什么办法可以将此功能添加到 tablesort 中?

【问题讨论】:

  • 抱歉缺少点(。),它仍然无法正常工作

标签: php html css html-table tablesorter


【解决方案1】:

您在表的类名之前缺少.

您的 CSS 代码应如下所示,

.tablesorter thead{
display:block;
}
.tablesorter tbody{
    height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    display: block ;
}

应该是.tablesorter tbody 而不是tablesorter tbody

演示: https://jsfiddle.net/ybb7aw47/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-21
    • 2017-02-08
    • 1970-01-01
    • 1970-01-01
    • 2016-12-25
    • 2018-09-04
    • 1970-01-01
    相关资源
    最近更新 更多