在table中增加 style="white-space: nowrap;" ,这样会撑大td。会出现滚动条其他内容配置:
每列宽度:
 "aoColumnDefs": [
{ "sWidth": "10%", "aTargets": [ 0 ] },
{ "sWidth": "12%", "aTargets": [ 1 ] },
{ "sWidth": "10%", "aTargets": [ 2 ] },
{ "sWidth": "10%", "aTargets": [ 3 ] },
{ "sWidth": "48%", "aTargets": [ 4 ] },
{ "sWidth": "10%", "aTargets": [ 5 ] }
],

 dataTables去掉搜索框和每页多少条框体

$(document).ready(function() {
$('#example').dataTable( {
"processing": true,
"serverSide": true,
"searching" : false,
"bSort": false,
"bLengthChange":false,
"ajax": {
url:"getSqlLogs",
data:{"index":index,"type":type}
},
"columns": [
{ "data": "rowId" },
{ "data": "message" },
{ "data": "type" },
{ "data": "timestamp" },
],
language: {
"sProcessing": "处理中...",
"sLengthMenu": "显示 _MENU_ 项结果",
"sZeroRecords": "没有匹配结果",
"sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
"sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
"sInfoFiltered": "(由 _MAX_ 项结果过滤)",
"sInfoPostFix": "",
"sSearch": "搜索:",
"sUrl": "",
"sEmptyTable": "表中数据为空",
"sLoadingRecords": "载入中...",
"sInfoThousands": ",",
"oPaginate": {
"sFirst": "首页",
"sPrevious": "上页",
"sNext": "下页",
"sLast": "末页"
},
"oAria": {
"sSortAscending": ": 以升序排列此列",
"sSortDescending": ": 以降序排列此列"
}
}
} );
} );

  

05-06 18:07