我正在JQUERY Datatable中工作。我填寫了表格中的數據。另外,我介紹了水平滾動,垂直滾動和固定列。JQuery Datatable - 標題對齊問題
我的股利和表如下..
<div id="div1" style="padding-left: 5px;">
</div>
<table class='tftable' cellspacing='0' rules='all' border='1' id='ItemDetails' cellpadding='0' style='font-family: Arial; border-collapse:collapse;width:150%;'>
<thead>
<tr class='tftable'>
...............
</tr>
</thead>
<tbody>
..........
</tbody>
</table>
我綁定表來覈實。
$("#div1").html(html)
CSS和JS使用:
<link rel="stylesheet" type="text/css" href="../Scripts/jquery-plugins/dataTables/dataTables/1.9.4/css/jquery.dataTables.css" />
<script type="text/javascript" src="../Scripts/jquery-plugins/dataTables/dataTables/1.9.4/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../Scripts/jquery-plugins/dataTables/fixedHeader/2.0.6/FixedHeader.min.js"></script>
<script src="../Scripts/jquery-plugins/dataTables/fixedColumns/2.0.3/FixedColumns.min.js"></script>
我的document.ready是
$(document).ready(function() {
var oTable = $('#ItemDetails').dataTable({
"bAutoWidth": false,
"bPaginate": true,
"bSort": true,
"sScrollX": "100%",
"bScrollCollapse": true,
"sScrollY": "395px",
"aoColumns": [{ "sWidth": "15%" }, { "sWidth": "2%" }, { "sWidth": "2%" }, { "sWidth": "8%" }, { "sWidth": "5%" }, { "sWidth": "6%" }, { "sWidth": "7%" }, { "sWidth": "10%" }, { "sWidth": "3%" }, { "sWidth": "2%" }, { "sWidth": "4%" }, { "sWidth": "5%" }, { "sWidth": "5%" }, { "sWidth": "10%" }, { "sWidth": "10%" }],
"aoColumnDefs": [
{
"bSortable": false, "aTargets": [1,2,3,4,5,6,7,8,9,10,11,12,13,14]
}
]
});
new FixedColumns(oTable, {
"iLeftColumns": 3,
});
});
這是我的問題,
在結果表中,頭和身體列未正確對齊。我搜索了很多鏈接。但我力求得到任何解決方案。
是的,我使用的是https://datatables.net/。另外,我更新了我的問題。 – RobinHood