0
我申請DataTables 利用過濾,在我的HTML表格排序和分頁。我使用下面的代碼將這些屬性應用到表:數據表組合框的寬度
$(document).ready(function() {
<!-- Sorting and pagination -->
var oTable = $('#mainTable').dataTable({
"sPaginationType": "full_numbers",
"bJQueryUI": true
});
<!-- Filtering -->
$("thead td").each(function (i) {
<!-- Create and populate combo boxes -->
this.innerHTML = fnCreateSelect(oTable.fnGetColumnData(i));
<!-- Filter data when selection changes -->
$('select', this).change(function() {
oTable.fnFilter($(this).val(), i);
});
});
});
在函數調用:
fnCreateSelect(oTable.fnGetColumnData(i));
..the組合框充滿了從表中的數據。但是,這些框會自動調整大小以包含值的全部長度(其中一些跨越多行),因此列的大小太大並且無法從頁面運行。我確定這不是一個CSS問題,所以我需要的是一種讓組合框對每個條目使用多行的方法,或者只顯示一部分值,以便我可以將所有這些列放在一個頁面上。
在此先感謝!