var oTable =$('#test').dataTable( {
"bJQueryUI": true,"aaData": aDataSet,"sPaginationType": "full_numbers","oTableTools": {
"aButtons": [ {"sExtends": "csv","sButtonText": "Save as CSV"}],"sSwfPath": "js/jquery/copy_csv_xls.swf"
},"bAutoWidth" : true,"sDom": '<"H"lCf>t"H"<"F"iTp>',"aoColumnDefs": [
{ "bVisible": true,"aTargets": [ 11 ] }
],"aoColumns": [
{ "sTitle": "column1" },{ "sTitle": "column1" },{ "sTitle": "column1"},{ "sTitle": "column1 By"},{ "sTitle": "column1 Date"}
]
} );
oTable.fnAdjustColumnSizing();
});
我希望所有列都至少根据其标头值自动调整大小.
最佳答案
你就是这样做,如果它是一个“正常”< table> :
原文链接:https://www.f2er.com/jquery/427818.htmlth,td {
white-space: nowrap;
}
看fidle – > http://jsfiddle.net/YrWG5/有一些极长的标题/内容.