【发布时间】:2013-09-06 03:31:07
【问题描述】:
仅使用数据表
<div class="dataTables_scroll">
<div class="dataTables_scrollHead" style="overflow: hidden; position: relative; border: 0px none; width: 100%;">
<div class="dataTables_scrollHeadInner" style="width: 7548px; padding-right: 17px;">
<table class="display dataTable" cellspacing="0" cellpadding="0" border="0" style="margin-left: 0px; width: 7548px;">
使用引导程序后
<div class="dataTables_scroll">
<div class="dataTables_scrollHead" style="overflow: hidden; position: relative; border: 0px none; width: 7565px;">
<div class="dataTables_scrollHeadInner" style="width: 4401px; padding-right: 17px;">
<table class="display dataTable" cellspacing="0" cellpadding="0" border="0" style="margin-left: 0px; width: 4401px;">
所以我不得不恢复以前的 css。我还需要引导程序,因为还有其他依赖于它的 css,但引导程序也更改了数据表的 CSS。临时解决办法是
$('.dataTables_scrollHead').css('width','100%');
$('.dataTables_scrollHeadInner').css('widht','7548');
$('.dataTable, .display').css('width','7548');
是否有任何解决方案使引导程序不会触及我的数据表 CSS? 谢谢!!!
【问题讨论】:
-
是的,我也查看了datatables.net/blog/Twitter_Bootstrap_2,但我不太确定如何将我的问题与 Booststrap 2 中所做的更改联系起来### 我使用的是 Bootstrap v2.3.2
-
你在哪里追加你的表知道你需要像这样改变 style="position:relative; overflow:scroll;"并注释scrollY, var table = $('#datatable').DataTable( { "dom": 't', "bSort": false, "paging ": false, //"scrollY":"450px" } );
标签: javascript jquery css twitter-bootstrap jquery-datatables