代码:
table {
border-radius: 3px;
margin-top: 5px;
margin-left: 5px;
margin-right: 5px;
}<div class="table-responsive-md">
<table class="table table-striped table-bordered table-hover table-sm text-light">
<caption>The todo-List</caption>
<thead class="thead-dark">
<tr>
<th>#</th>
<th>Date of Diclaration</th>
<th>Date of Finish</th>
<th>Target To Be Nailed</th>
</tr>
</thead>
<tbody>
<tr class="bg-primary">
<td>1</td>
<td>13 nov 1998</td>
<td>13 nov 2019</td>
<td>Meet her</td>
</tr>
<tr class="bg-dark ">
<td>1</td>
<td>13 nov 1998</td>
<td>13 nov 2019</td>
<td>Meet her</td>
</tr>
</tbody>
</table>
</div>
我知道我要问你的问题是愚蠢的,但请你帮帮我,好的!当边距-左操作得很好的时候,我无法为表做右边距,我已经尝试将它改为右边距:50 to或5%;但是没有什么是有效的,out..so,请建议修改一下以得到right..thanks。
发布于 2018-12-09 09:42:56
.table-responsive-md{
padding-left:5px;
padding-right:5px;
}<div class="table-responsive-md">
<table class="table table-striped table-bordered table-hover table-sm text-light">
<caption>The todo-List</caption>
<thead class="thead-dark">
<tr>
<th>#</th>
<th>Date of Diclaration</th>
<th>Date of Finish</th>
<th>Target To Be Nailed</th>
</tr>
</thead>
<tbody>
<tr class="bg-primary">
<td>1</td>
<td>13 nov 1998</td>
<td>13 nov 2019</td>
<td>Meet her</td>
</tr>
<tr class="bg-dark ">
<td>1</td>
<td>13 nov 1998</td>
<td>13 nov 2019</td>
<td>Meet her</td>
</tr>
</tbody>
</table>
</div>
由于表是全宽的,边距右不工作。如果您在父标记上使用填充左和填充右,那么您将做您想做的事情。
https://stackoverflow.com/questions/53690875
复制相似问题