html - 如何使 Twitter Bootstrap 表列彼此更接近?

标签 html twitter-bootstrap html-table

我有一个来自 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>

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

最佳答案

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

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

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

关于html - 如何使 Twitter Bootstrap 表列彼此更接近?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22523355/

相关文章:

html - 删除菜单和轮播之间的空格 Twitter bootstrap 2.2.2

css - 如何在移动设备上的 2 个表 1 中设置 2 个按钮,html django 模板

html - 使 Rmarkdown 中的 htmlwidgets 移动友好

javascript - 生成 Angular JS href

javascript - 输入 : hover 上的 Bootstrap Popover

html - 使表格数据 Angular 接触

html - Opera 忽略的嵌套表格的 CSS 填充

javascript - 如何通过一个 onclick 事件更改两个单独的图像?

javascript - 使用提交按钮而不是页面上的其他按钮提交表单

javascript - 验证 Bootstrap 4 表单的两个复选框