In the following example, text-center does not affect the table header. The text in table body is displayed normally (center aligned) but not the header
<table class="table table-condensed table-hover text-center">
<thead>
<tr>
<th class="text-center">Room Id</th>
</tr>
</thead>
We set th { text-center: left; }, which is more specific than the class on the parent <table> and thus prevents the header cell from inheriting the centering styles. Putting the .text-center class directly on the <th> should work though (confirmed in the docs).
As our documentation for the text alignment classes shows them being used on paragraphs and doesn't claim compatibility with tables, I'd recommend using custom CSS to override Bootstrap's table header styles instead of using alignment classes in this situation.
/cc @mdo to confirm or deny
Ok thanks
Most helpful comment
We set
th { text-center: left; }, which is more specific than the class on the parent<table>and thus prevents the header cell from inheriting the centering styles. Putting the.text-centerclass directly on the<th>should work though (confirmed in the docs).As our documentation for the text alignment classes shows them being used on paragraphs and doesn't claim compatibility with tables, I'd recommend using custom CSS to override Bootstrap's table header styles instead of using alignment classes in this situation.
/cc @mdo to confirm or deny