It is easy to align table by setting "align" attribute, but table aligning by css is a bit hacky. Is there built-in support for tables aligning in Twitter Bootstrap 2.0?
There is nothing built in to support this but it is very easy to add something like:
.table th.rightCell, .table td.rightCell { text-align: right; }
Bootstrap's alignment classes include .text-right
which sets text-align: right
.
Unfortunately Bootstrap sets text-align: left
for table cells so applying .text-right
to a <td>
doesn't have any effect:
<td class="text-right">
Still left aligned
</td>
Adding .text-right
to a block element inside the cell however does work:
<td>
<p class="text-right">Right aligned</p>
</td>
<td>
<div class="text-right">Right aligned</div>
</td>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With