2014-04-02 29 views
0

在jQuery數據表中,當我包含bootstrap css時,水平滾動條不會出現。我知道,有些樣式正在覆蓋數據表。有人能幫助我,哪種風格造成問題?jQuery Datatable - 帶Bootstrap CSS的水平滾動條

Demo

腳本

$(document).ready(function() { 
    $('#example').dataTable({ 
     "sScrollX": "100%", 
     "sScrollXInner": "110%", 
     "bScrollCollapse": true 
    }); 
}); 

在此先感謝。

回答

1

bootstrap應用了一種樣式,允許表格的最大寬度爲100%。

table { 
    background-color: rgba(0, 0, 0, 0); 
    max-width: 100%; 
} 

如果您禁用/擦除此最大寬度,則會出現滾動。或者僅覆蓋表格的樣式:

table { 
max-width: none !important; 
} 

如果您的樣式不覆蓋引導程序的樣式,請添加「!important」。