【发布时间】:2018-03-07 07:28:00
【问题描述】:
我已经为 header 和 body 定义了两个表。当表格大小超过 6 时,我想要正文的滚动条。但是当滚动条出现时,alignmnet 受到干扰,因为滚动条占用了 16px。其他列被调整大小。
<table id="myProjects" class="table table-hover table-bordered table-striped table-condensed table-scrollable">
<thead>
<tr>
<th>Head 1</th>
<th>Head 2</th>
<th>Head 3</th>
<th>Head 4</th>
<th>Head 5</th>
</tr>
</thead>
</table>
<table id="myProjects" class="table table-hover table-bordered table-striped table-condensed table-scrollable">
<tbody>
<tr>
<td>Content 1</td>
<td>Content 2</td>
<td>Content 3</td>
<td>Content 4</td>
<td>Content 5</td>
</tr>
</tbody>
</table>
have tried all these css classes, but its not working
#myProjects thead th:last-child {
width: 161.133px;
}
*
#myProjects tbody tr:last-child td {
width: 145.133px;
}
#myProjects{
width:924.999px;
}
【问题讨论】:
-
真正的问题是......为什么要定义两个表而不是一个??
-
你需要定义100%的宽度。
-
Benjoe,我也尝试将宽度设为 100%,但它不起作用。
-
@Facundo 我只想在正文部分显示滚动条。
标签: css