Use .text-center
<tr>
<th colspan="2" class="text-center">aaaaaa</th>
</tr>
Frage
<table class="table table-striped table-bordered table-condensed">
<tr>
<th colspan="2">aaaaa</th>
</tr>
<tr>
<td>cccccccccc</td>
<td>dddddddddd</td>
</tr>
</table>
how to make "aaaaa" in the middle of the head of table in html with bootstrap?
Lösung
Use .text-center
<tr>
<th colspan="2" class="text-center">aaaaaa</th>
</tr>
Andere Tipps
Just use the CSS style text-align
and set it to center
:
.table {
text-align:center;
}
or if you just want table headers aligned to the center:
.table th {
text-align:center;
}