Jquery 数据表:';bAutoWidth:false';当'时不工作;sScrollY';设定
我使用datatables在页面加载后重新格式化已经存在的表/DOM。我已经在Jquery 数据表:';bAutoWidth:false';当'时不工作;sScrollY';设定,jquery,datatable,Jquery,Datatable,我使用datatables在页面加载后重新格式化已经存在的表/DOM。我已经在thead <table border="1" style="table-layout: fixed; word-wrap: break-word;" id='myTable'> <thead> <tr>
thead
<table border="1" style="table-layout: fixed; word-wrap: break-word;"
id='myTable'>
<thead>
<tr>
<th>GroupName</th>
<th style='width: 60%;'>Grouped By </th>
<th style='width: 15%;'>Count</th>
<th style='width: 25%;'>Download</th>
</th>
</thead>
<tbody>....</tbody>
</table>
问题是-当设置sScrolly
时,datatables会自动计算宽度,并为所有列设置相等的宽度,因为bAutoWidth
设置为false。禁用时,列宽将根据百分比进行适当设置。
有没有关于如何让它工作的建议
谢谢我在datatables论坛上发布了这个问题,并从作者那里得到了答案/修复。 以防有人在这里偶然发现
oTable = jq("#myTable").dataTable(
{
"bSort" : false,
"bLengthChange" : false,
"bJQueryUI" : true,
"bPaginate" : false,
"sScrollY": "200px",
"bAutoWidth": false // Disable the auto width calculation
}).rowGrouping(
{
bExpandableGrouping : true //group by first column
});