Css Twitter Bootstrap 2.0是否内置了任何东西来对齐表内容?

Css Twitter Bootstrap 2.0是否内置了任何东西来对齐表内容?,css,twitter-bootstrap,twitter-bootstrap-2,Css,Twitter Bootstrap,Twitter Bootstrap 2,通过设置“align”属性来对齐表是很容易的,但是通过css对齐表有点粗糙。Twitter Bootstrap 2.0中是否内置了对表对齐的支持?没有内置支持,但添加如下内容非常容易: .table th.rightCell, .table td.rightCell { text-align: right; } 对于“td”,我使用了bootstrap css中包含的这一点: <td class="pagination-centered"> 引导包括.text right设

通过设置“align”属性来对齐表是很容易的,但是通过css对齐表有点粗糙。Twitter Bootstrap 2.0中是否内置了对表对齐的支持?

没有内置支持,但添加如下内容非常容易:

.table th.rightCell,
.table td.rightCell {
  text-align: right;
}
对于“td”,我使用了bootstrap css中包含的这一点:

<td class="pagination-centered">

引导包括
.text right
设置
文本对齐:right

不幸的是,引导设置表单元格的
文本对齐:左
,因此将
文本右
应用于
不会产生任何效果:

<td class="text-right">
  Still left aligned
</td>

我不确定这是不是“黑客”。Bootstrap只是一个启动程序,是用来构建的。或者,为了保持Bootstrap的命名约定,并利用预构建的
text right
类,您应该将其添加到您自己的css:
.table th.text-right、.table td.text-right{text align:right;}
然后使用
Ta dam
我使用的是Bootstrap 3.0和
。文本右键
在直接应用于
的“分页中心”时效果非常好
<td>
  <p class="text-right">Right aligned</p>
</td>
<td>
  <div class="text-right">Right aligned</div>
</td>