H C*_*H C 12 html css twitter-bootstrap
我试图使用bootstrap中心表.
这是html:
<div class="container-fluid">
<table id="total votes" class="table table-hover text-centered">
<thead>
<tr>
<th>Total votes</th>
<th> = </th>
<th>Voter A</th>
<th> + </th>
<th>Voter B</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ total_votes }}</td>
<td> = </td>
<td>{{ total_voter_a }}</td>
<td> + </td>
<td>{{ total_voter_b }}</td>
</tr>
</tbody>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
但是,无论我如何调整css
,桌子仍然与左边对齐.我确定我错过了一些简单的事情.我还以为container-fluid
会让这个表跨越整个页面.
这是css:
.table th {
text-align: center;
}
.table {
border-radius: 5px;
width: 50%;
float: none;
}
Run Code Online (Sandbox Code Playgroud)
Ant*_*jan 28
你错过了 margin:auto
.table {
border-radius: 5px;
width: 50%;
margin: 0px auto;
float: none;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
62825 次 |
最近记录: |