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