【问题标题】:How to make Twitter bootstrap table columns closer to each other?如何使 Twitter 引导表列彼此更接近?
【发布时间】:2014-04-26 17:31:58
【问题描述】:

我有一个来自 Twitter Bootstrap v3.0.3 的简单表格。它只有 2 列。下面是表格的html代码。

<table class="table table-bordered">
  <thead>
    <tr>
      <th>Head1</th>
      <th>Head2</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Address</td>
      <td>Test</td>
    </tr>
  </tbody>
</table>

我希望表格的列彼此靠近。如何才能做到这一点?谢谢。

【问题讨论】:

  • 你能提供链接或jsfiddle吗?

标签: html twitter-bootstrap html-table


【解决方案1】:

如果我理解正确,您希望表格的宽度适合内容。

最简单的方法是设置width: auto:

<table class="table table-bordered" style="width: auto">

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-04
    • 1970-01-01
    • 2020-08-27
    • 2016-10-07
    • 2015-01-28
    • 1970-01-01
    • 2019-06-07
    • 1970-01-01
    相关资源
    最近更新 更多