Html mozilla数据表列宽问题
我正在为我的一个项目使用数据表。在这种情况下,在ajax请求(返回视图)之后,我将使用排序选项初始化响应数据上的数据表。该表包含大量列,并具有水平滚动条,这对我来说很好 问题是列标题未正确呈现,它们位于新行上,如图所示 这是我的初始化代码:Html mozilla数据表列宽问题,html,css,tabs,datatables,Html,Css,Tabs,Datatables,我正在为我的一个项目使用数据表。在这种情况下,在ajax请求(返回视图)之后,我将使用排序选项初始化响应数据上的数据表。该表包含大量列,并具有水平滚动条,这对我来说很好 问题是列标题未正确呈现,它们位于新行上,如图所示 这是我的初始化代码: //There can be multiple instances of datatable created after ajax request. $('.query_result_table').each(function(){
//There can be multiple instances of datatable created after ajax request.
$('.query_result_table').each(function(){
var temp = $(this).dataTable( {
"sPaginationType": "full_numbers",
"bDestroy":true,
"bProcessing": true,
"bJQueryUI": true,
/*"bAutoWidth": true,
"sScrollXInner": "100%",*/
"aoColumnDefs": [
{
"bSortable": false,
"aTargets": [ 'no_click' ]
}],
"fnInitComplete": function() {
this.fnAdjustColumnSizing();
}
});
setTimeout(function()
{
temp.fnAdjustColumnSizing();
}, 10);
//$(this).fnAdjustColumnSizing();
});
上述问题似乎出现在Mozilla中。在铬合金中,它工作得很好
你知道我该怎么解决这个问题吗
--非常感谢您抽出时间解决了以下问题:
//There can be multiple instances of datatable created after ajax request.
$('.query_result_table').each(function(){
var temp = $(this).dataTable( {
"sPaginationType": "full_numbers",
"bDestroy":true,
"bProcessing": true,
"bJQueryUI": true,
"bAutoWidth": false, //Disabled auto width calculation....
"aoColumnDefs": [
{
"bSortable": false,
"aTargets": [ 'no_click' ]
}],
"fnInitComplete": function() {
this.fnAdjustColumnSizing();
}
});
setTimeout(function()
{
temp.fnAdjustColumnSizing();
}, 10);
//$(this).fnAdjustColumnSizing();
});
CSS:
.query_result_table {
width:2500px;
max-width:none;
}
这可能是css的问题。你检查过了吗?我没有通过css给单元格加宽度,我已经交叉检查过了。