我正在使用footable (一个 jquery 脚本,用于使表格在手机、平板电脑等上响应)但我有一个问题。对于我的项目来说,触摸并单击每一行的展开是不必要的。
通常使用此代码可以正常工作:
<table class="footable">
<thead>
<tr>
<th data-class="expand">
First Name
</th>
<th>
Last Name
</th>
<th data-hide="phone,tablet">
Job Title
</th>
<th data-hide="phone,tablet">
DOB
</th>
<th data-hide="phone">
Status
</th>
</tr>
</thead>
$(function() { $('table').footable(); });
但是我如何默认展开所有行?
jsfiddle 上的示例代码
最佳答案
查看此演示 http://jsfiddle.net/yeyene/nZEu2/2/
在您的 footable 调用之后添加这一行脚本 $('table tr').addClass('footable-detail-show');
$(document).ready(function(){
$(function() {
$('table').footable();
});
$('table tr').addClass('footable-detail-show');
});
关于jquery - 如何用jquery显示隐藏行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17645527/