0
我有一個responsive-table
在td
與colspan
。代替responsive-table
限制寬度併爲內部表格創建滾動條,它將表格拉伸到對於屏幕來說太大。是否有任何css
可以添加到使這項工作,而不是在responsive-table
div
設置明確的寬度?表中的`.responsive-table`不會創建一個滾動條
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div style="width: 50px">
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
<tr>
<td colspan="2">
<div class="table-responsive">
<table class="table table-bordered">
<tbody>
<tr>
<td>Test1</td>
<td>Test2</td>
<td>Test3</td>
<td>Test4</td>
<td>Test5</td>
<td>Test6</td>
<td>Test7</td>
<td>Test8</td>
<td>Test9</td>
<td>Test10</td>
<td>Test11</td>
<td>Test12</td>
<td>Test13</td>
<td>Test14</td>
<td>Test15</td>
<td>Test16</td>
<td>Test17</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
我希望它看起來像這樣,無需設置在td
內div
一個明確的寬度。
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<div style="width: 50px">
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
<tr>
<td colspan="2">
<div class="table-responsive" style="width: 50px">
<table class="table table-bordered">
<tbody>
<tr>
<td>Test1</td>
<td>Test2</td>
<td>Test3</td>
<td>Test4</td>
<td>Test5</td>
<td>Test6</td>
<td>Test7</td>
<td>Test8</td>
<td>Test9</td>
<td>Test10</td>
<td>Test11</td>
<td>Test12</td>
<td>Test13</td>
<td>Test14</td>
<td>Test15</td>
<td>Test16</td>
<td>Test17</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
我更新了我與我所期望的佈局看起來像的問題。 –