如何设置bootstrap table的宽度?
我尝试使用 class="col-md-2"
,它不影响宽度。表格类的宽度似乎等于显示宽度。
在我的例子中,我有很多信息要通过表格显示,这些信息将超过显示器的宽度,因此我需要水平滚动条。
这是我试过的最后一个代码。
<table class="table">
<tr>
<th class="col-md-1">Action</th>
<th class="col-md-2">Description</th>
</tr>
<tr ng-repeat="x in Tablelist track by $index">
<td>
<div class="btn-group">
<button class="btn btn-primary btn-xs" ng-click="Opensetprice(x.id,x.matcode,x.pr_qty)">$</button>
<button class="btn btn-danger btn-xs" ng-click="Delete(x.doc_no,x.item_no, $index)">X</button>
</div>
</td>
<td>{{x.material}}</td>
</tr>
</table>
试图用 width:auto;
覆盖类 table
宽度,没有任何帮助。
最佳答案
给你的表父 overflow: auto;
关于css - 每列的 Bootstrap 表格自定义宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37652492/