所有列最小宽度的表,除了在引导中拉伸的列

  • 本文关键字:最小宽度 css twitter-bootstrap
  • 更新时间 :
  • 英文 :


我正在寻找一种方法来让引导程序制作如下表:

----------------------------------------------------------|
| name |  date  | message                                 |
----------------------------------------------------------|
| test | 12-12  | this one fills up the rest of the space |
----------------------------------------------------------|
| test | 13-12  | this one fills up the rest of the space |
----------------------------------------------------------|

所有列都应尽可能使用其最小宽度,而一列则拉伸到剩余空间。我试图通过col-xs-*实现这一目标,但这远非动态解决方案。

有什么建议吗?可能是自定义代码。

谢谢

您可以将widthmax-width结合使用吗?

如果将<th>设置为类或 ID(如 name 是 <th id="name">,date 是 <th id="date"> 等(,则可以完成将其余空间专用于表中的消息。然后在您的 CSS 中,执行以下操作:

#name {
  width: 100px;
  max-width: 100px;
}
#date {
  width: 100px;
  max-width: 100px;
}

JSFiddle.

最新更新