PHP制表,边框问题
怎么让后两行的中间边框消失??效果如图11
<style type="text/css">
table,table tr td {
border: 1px solid #000;
text-align: center;
border-collapse: collapse;
}
table tr td {
padding: 10px 30px;
/*border-right: 1px solid transparent;*/
}
span{
color: #ff000c;
}
.abc{
border-right: 1px solid transparent;
}
</style>
<?php
$a1=2;
$a2=7.99;
$b1=1;
$b2=6.89;
$c1=3;
$c2=3.99;
$sum=$a1*$a2+$b1*$b2+$c1*$c2;
$str="<table>
<tr>
<td>商品名称</td><td>购买数量(斤)</td><td>商品价格(元/斤)</td>
</tr>
<tr>
<td>香蕉</td><td>$a1</td><td>$a2</td>
</tr>
<tr>
<td>苹果</td><td>$b1</td><td>$b2</td>
</tr>
<tr>
<td>橘子</td><td>$c1</td><td>$c2</td>
</tr>
<tr class='abc'>
<td></td><td></td><td>商品折扣:<span>0.8</span></td>
</tr>
<tr id='abc'>
<td></td><td></td><td>打折后购买商品总价格:<span>$sum</span>元</td>
</tr>";
$str .= "</table>";
echo $str;
?>
懂用table这问题 就在简单不过了
$str="<table>
<tr>
<td>商品名称</td><td>购买数量(斤)</td><td>商品价格(元/斤)</td>
</tr>
<tr>
<td>香蕉</td><td>$a1</td><td>$a2</td>
</tr>
<tr>
<td>苹果</td><td>$b1</td><td>$b2</td>
</tr>
<tr>
<td>橘子</td><td>$c1</td><td>$c2</td>
</tr>
<tr class='abc'>
<td colspan="3">商品折扣:<span>0.8</span></td>
</tr>
<tr id='abc'>
<td colspan="3">打折后购买商品总价格:<span>$sum</span>元</td>
</tr>";
$str .= "</table>";
页:
[1]