出于某种原因,在我的网站上,我的 jQuery 数据表的列标题没有与行对齐。
这是一个示例:
请注意,我的一些表格(包括上述表格)位于 Bootstrap 选项卡中。我相信这是原因,因为当它们不在选项卡中时,它们显示得很好。
我知道引导程序认为其他选项卡中的数据“不可见”,所以我认为它与此有关。
有人有简单的css或js修复吗?提前致谢。
编辑,这里有一些代码:
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="<?php echo $tab_1; ?>"><a href="#activeusers" class="tab-nonwhitetext" aria-controls="activeusers" role="tab" data-toggle="tab">Active Users</a></li>
<li role="presentation" class="<?php echo $tab_2; ?>"><a href="#inactiveusers" class="tab-nonwhitetext" aria-controls="inactiveusers" role="tab" data-toggle="tab">Inactive Users</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane <?php echo $tab_1; ?>" id="activeusers">
<?php echo $table1; ?>
</div>
<div role="tabpanel" class="tab-pane <?php echo $tab_2; ?>" id="inactiveusers">
<?php echo $table2; ?>
</div>
</div>
<table "border="0" cellpadding="3" cellspacing="20" class="display dataTable new-table-styling dynamic-table" id="table" width="100%">
<thead>
<tr>
<th>First Name</th><th>Last Name</th><th>Job Title/Education</th><th>Room/Phone(s)</th><th>Email/Supervisor</th><th>Employee Type</th><th>Image</th><th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
</tr>
</tbody>
</table>