0
我想添加nowrap爲我的jquery數據表而沒有成功。從json動態jquery數據表的Nowrap
這樣的事情(不工作)
$.ajax({
"url": 'invokeHawkAgent.gsp',
"success": function (json) {
json.bDestroy = true;
$('#tabs-1-contents').dataTable({'data':json,
"fnRowCallback": function(nRow, aData, iDisplayIndex) {
$('td', nRow).attr('nowrap','nowrap');
return nRow;
}
});
},
"dataType": "json"
});
工作(但沒有NOWRAP)
$.ajax({
"url": 'invokeHawkAgent.gsp',
"success": function (json) {
json.bDestroy = true;
$('#tabs-1-contents').dataTable(json);
},
"dataType": "json"
});
任何想法如何NOWRAP添加到這個?
謝謝!
你爲什麼不只是從CSS設置呢? – Nelson
其實我想用jquery在dataTable函數的表中添加更多的特性。設置nowrap只是實現這一目標的第一步。 – user955732
Duplicate:http://stackoverflow.com/questions/2270244/datatables-jquery-plugin-nowrap-for-ajax-table? @ user955732 http://datatables.net/forums/discussion/1365/nowrap-for-ajax-table/p1討論了這個問題,並提供了兩種解決方法,試一下,如果有效,你可以發佈你自己的答案。 –