【发布时间】:2021-09-01 14:04:45
【问题描述】:
除非我添加以下内容,否则我无法让水平滚动与表格响应一起工作: style = "width: 1000px" 到表格(见下文)。但这会导致垂直滚动条(如果有)移动到表格的右侧。
有人能指出正确的方向吗?
<!-- table -->
<div class="table-responsive">
<table class="m-auto table table-striped table-hover"
style = "width: 1000px'">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">COL 02 - 20</th>
<th scope="col">COL 03 - 20</th>
<th scope="col">COL 04 - 30</th>
<th scope="col">COL 05 - 10</th>
<th scope="col">COL 06 - 10</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Row 01 - Col 01</td>
<td>Row 01 - Col 02</td>
<td>Row 01 - Col 03</td>
<td>Row 01 - Col 04</td>
<td>Row 01 - Col 05</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Row 02 - Col 01</td>
<td>Row 02 - Col 02</td>
<td>Row 02 - Col 03</td>
<td>Row 02 - Col 04</td>
<td>Row 02 - Col 05</td>
</tr>
<tr>
<th scope="row">3</th>
<td>Row 03 - Col 01</td>
<td>Row 03 - Col 02</td>
<td>Row 03 - Col 03</td>
<td>Row 03 - Col 04</td>
<td>Row 03 - Col 05</td>
</tr>...etc...
<tr>
<th scope="row">6</th>
<td>Row 06 - Col 01</td>
<td>Row 06 - Col 02</td>
<td>Row 06 - Col 03</td>
<td>Row 06 - Col 04</td>
<td>Row 06 - Col 05</td>
</tr>
</tbody>
</table>
</div>
【问题讨论】:
标签: html-table responsive bootstrap-5