[英]JS dataTables.fixedHeader different width between header and datas
我使用javascript插件dataTables.fixedHeader並用ajax填充數據。 現在我遇到的問題是,每個數據列的寬度是動態的,並且標題保持在相同的靜態寬度上。
碼:
HTML:
<table class="table table-striped table-bordered table-hover" id="custTable">
<thead>
<tr>
<th>
......
</th>
<th>
......
</th>
<th>
......
</th>
......
</tr>
</thead>
<tbody id="dataList"></tbody>
</table>
JS:
table = $('#custTable').DataTable({
"dom": "frtiS",
"deferRender": true,
});
填充:
$('#custTable').dataTable().fnAddData([
xyz, xyz, xyz, ...
]);
禁用自動列寬。
JS
table = $('#custTable').DataTable({
"dom": "frtiS",
"deferRender": true,
"autoWidth": false
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.