左边侧边栏边距 使用cellpadding属性没有效果,帮我看下是什么问题
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Document</title>
<style type="text/css">
*{
margin:0;
padding:0;
}
.right tr {
height:54px;
}
.right tr td {
border:1px solid #cccccc;
}
</style>
</head>
<body>
<table width="100%" cellspacing="0">
<thead>
<tr height="60px" bgcolor="#169bd5">
<td colspan="2"><img src="../image/logo.png" height="40" width="128" alt="" /></td>
</tr>
</thead>
<tbody>
<tr>
<td width="12%" valign="top" >
<table class="left" cellspacing="20">
<tr><td>商品管理</td></tr>
<tr><td>平价管理</td></tr>
<tr><td>咨询管理</td></tr>
<tr><td></td></tr>
<tr><td><b>全部订单</b></td></tr>
<tr><td>已完成订单</td></tr>
<tr><td>待处理订单</td></tr>
<tr><td>今日物流</td></tr>
<tr><td></td></tr>
<tr><td>月考核</td></tr>
<tr><td>季度考核</td></tr>
<tr><td>年度考核</td></tr>
</table>
</td>
<td width="88%">
<table class="right" width="100%" cellspacing="0" border="2">
<tr>
<td colspan="8"> 全部订单</td>
</tr>
<tr>
<td colspan="8"> 查询:<input type="date"/> 至 <input type="date"/></td>
</tr>
<tr>
<td colspan="2">宝贝信息</td>
<td>订单数量</td>
<td>单价</td>
<td>买家</td>
<td>下单时间</td>
<td>实付款</td>
<td>订单操作</td>
</tr>
<tr>
<td><img src="../image/txue.png" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>小明</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>待付款</td>
</tr>
<tr>
<td><img src="../image/xie.jpg" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>小李子</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
<tr>
<td><img src="../image/txue.png" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>小红</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>待发货</td>
</tr>
<tr>
<td><img src="../image/xie.jpg" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>可乐</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
<tr>
<td><img src="../image/txue.png" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>魏明</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
<tr>
<td><img src="../image/xie.jpg" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>李晓雨</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
<tr>
<td><img src="../image/txue.png" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>艳艳</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
<tr>
<td><img src="../image/xie.jpg" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>片片</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
<tr>
<td><img src="../image/txue.png" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>小兰</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
<tr>
<td><img src="../image/xie.jpg" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>魏璎珞</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
<tr>
<td><img src="../image/txue.png" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>小幕</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
<tr>
<td><img src="../image/txue.png" alt="" width="50px" height="50px" /></td>
<td>2019新款个性男女潮牌imooc幕春之行文化衫</td>
<td>2</td>
<td>120</td>
<td>小苏</td>
<td>2019-2-21 21:54</td>
<td>240</td>
<td>未发货</td>
</tr>
</table>
</td>
</tr>
</tbody>
<tfoot>
<tr height="60px" bgcolor="#169bd5">
<td colspan="2">2019-9-21 ©imooc.com</td>
</tr>
</tfoot>
</table>
</body>
</html>
正在回答
同学你好,非常抱歉老师之前没有看清楚。cellpadding设置不起作用是因为css中用通配符设置了padding值为0:
同学把对padding的设置去掉,将cellspacing修改为cellpadding就可以看出效果了:
或者这里使用cellspacing属性设置也是可以的,效果没问题。
祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星