如果值太长,我的数据表的列将变宽。
aTable = $("#printdata").dataTable({
"bAutoWidth" : false,
"bRetrieve" : true,
"scrollY": 200,
"scrollX": true,
"deferRender": true,
"scroller": {
loadingIndicator: true
},
"bServerSide": true,
"bProcessing": true,
"sAjaxSource": 'show2ndsampling.php',
"fnServerData": function (sSource,aoData,fnCallback){
$.ajax({
"dataType":'json',
"type":'POST',
"url":sSource,
"data":aoData,
"success":function(json){
fnCallback(json);
}
});
},
"order" : [[1,"desc"]],
"aoColumns" : [
/*serial*/{ "width": "30%", target : 3 }
]
但是我的数据表没有任何变化。
我会这样做
table.dataTable tbody td {
word-break: break-word;
vertical-align: top;
}
演示-> http://jsfiddle.net/qh63k1sg/
这意味着将autoWidth
其设置为false,并且您已为列指定了固定的宽度(如在演示中和OP所描述的,他使用aoColumns
/进行操作columns
)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句