[英]width of a header not filling entire space
I have a table, with a div which I am trying to add a header 我有一张桌子,有一个div,我正在尝试添加标题
<div class="table-responsive">
<table class="table">
<thead>
<div class="topPic"><span><i class="fa fa-tree fa-2x"></i></span></div>
</thead>
<tbody>
<tr>
<td class="text-center"><h3>Pienet puut</h3></td>
and the class topPic is where I put a picture and make it look like a header for a table But the problem is when the table goes to mobile size there is a space on the right like this. 而topPic类是我放置图片并使其看起来像表标题的位置,但是问题是当表达到移动大小时,像这样的右边就有一个空格。
I am not sure why is there a space on the right even when my CSS is like this. 我不确定为什么即使我的CSS像这样,右边也有空格。
.topPic{
background-color: rgba(70, 140, 0, 0.9);
padding: 10px;
text-align: center;
width : 100%;
}
Here is the whole code for the table if its necessary. 如果需要,这里是表的全部代码。
<div class="table-responsive">
<table class="table">
<thead>
<div class="topPic"><span><i class="fa fa-tree fa-2x"></i></span></div>
</thead>
<tbody>
<tr>
<td class="text-center"><h3>Pienet puut</h3></td>
<td >
<div class="form-group pushing-top">
<select name="small-trees-to-cut" class="form-control input-sm ">
<?php
for($i=0; $i<=20; $i++) {
echo("<option value='" . $i . "'>" . $i . "</option>");
}
?>
</select>
</div>
</td>
<td class="text-center" ><h4>Halkaisija 7-10cm<br> korkeus 9-12m<h3></td>
<td></td>
</tr>
<tr>
<td class="text-center"><h3>Keskisuuret puut</h3></td>
<td>
<div class="form-group pushing-top">
<select name="medium-trees-to-cut" class="form-control input-sm ">
<?php
for($i=0; $i<=20; $i++) {
echo("<option value='" . $i . "'>" . $i . "</option>");
}
?>
</select>
</div>
</td>
<td class="text-center" ><h4>Halkaisija 15-35cm <br>korkeus 12-17m<h3></td>
<td>
<div class="checkbox ">
<label class="pushing-top"><input type="checkbox" name="medium-tree-cutting-crane" value="1">
<h5>Kiipeilykaato</h5></label>
</div>
</td>
</tr>
<tr>
<td class="text-center"><h3>Suuret puut</h3></td>
<td>
<div class="form-group pushing-top">
<select name="large-trees-to-cut" class="form-control input-sm ">
<?php
for($i=0; $i<=20; $i++) {
echo("<option value='" . $i . "'>" . $i . "</option>");
}
?>
</select>
</div>
</td>
<td class="text-center" ><h4>Halkaisija 35-70cm<br> korkeus 17-28m<h3></td>
<td>
<div class="checkbox ">
<label class="pushing-top"><input type="checkbox" name="big-tree-cutting-crane" value="1">
<h5>Kiipeilykaato</h5></label>
</div>
</td>
</tr>
</tbody>
</table>
</div>
您应该使用col-span使表中的一列填充其他列而不是宽度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.