css - 无法修复 Bootstrap 中的列宽

标签 css twitter-bootstrap twitter-bootstrap-3

我正在尝试修复列的宽度(名称:链接)但无法在下面执行此操作是我的代码

<table class="table table-striped table-bordered">
<thead>
<th>ID</th>
<th>User</th>
**<th class="col-sm-2">Link</th>**
<th>Charge</th>
<th>Start count</th>
<th>Quantity</th>
<th>Type</th>
<th>Status</th>
<th>Date</th>

但是表的输出没有变化,你能告诉我我做错了什么吗?

最佳答案

您的 html 没有关闭 theadtable,但是当您正确设置 html 格式时,列类会起作用。许多人使用 table 上的类(class)。

.col-sm-2 从 min-width:768px 开始,它是父级(表格)宽度的 16.6666666666667%。它将保持该最小宽度的 16.6666666666667% 及以上,并将恢复为默认宽度。

演示:https://jsbin.com/mupeve

<table class="table table-striped table-bordered">
   <thead>
      <th>ID</th>
      <th>User</th>
      <th class="col-sm-2">Link</th>
      <th>Charge</th>
      <th>Start count</th>
      <th>Quantity</th>
      <th>Type</th>
      <th>Status</th>
      <th>Date</th>
   </thead>
</table>

关于css - 无法修复 Bootstrap 中的列宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27216621/

相关文章:

javascript - Bootstrap 3 scrollspy - 检测 div 上的滚动

html - BootStrap 3 构建主页面

html - 单击纸张输入打开纸张对话框

css - 如何在多行中显示选项卡,使额外的选项卡位于上一行而不是下一行?

jquery - 如何使用 bootstrap 和 booster 加载 jquery-1.11.2?

javascript - bootstrap 下拉菜单只有一半的时间有效

html - CSS3 显示为 block

JavaFX 圆 Angular 碰撞箱

html - Bootstrap中心div保持在长矩形中

html - 如何将 Bootstrap 下拉菜单应用到asp.net dropdownlist控件