我在写一个table,给table的td加上边框后,发现中间边框特别粗,所以就使用border-collapse:collapse解决。但是使用之后发现表格周围的边框不见了,请问这样改怎么解决?
css部分的代码如下
#tableWrap{width: 488px;height: 300px;margin: 0 auto;}
#tableWrap table{
width: 100%;height: 100%;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
overflow: hidden;
border-collapse: collapse;
border: 1px solid #000;
}
#tableWrap tr{height: 35px;}
#tableWrap tbody>tr>td{
border: 1px solid #000;
}
#tableWrap td{
width: 80px;
text-align: center;
font-size: 14px;
color: #000;
}
#tableWrap thead>tr{background: #f00;}
tableWrap是包裹table的div。
之后的变成了这样
HTML大概布局上是这样的
<div id="tableWrap">
<table cellspacing="0" cellpadding="0">
<thead>
<tr style="color: #fff;">
<th align="center" class="one">排名</th>
<th align="center" class="two">用户</th>
<th align="center" class="three">手机号</th>
<th align="center" class="four">投资金额</th>
<th align="center" class="five">奖励</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center" class="one num">dd</td>
</tr>
</tbody>
</table>
</div>
请问怎么解决?