日期:2014-05-17 浏览次数:20620 次
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>测试1</title>
<style>
table {border-collapse:collapse;border:1px solid black}
tr {position:relative;}
td {position:relative;border:none;border-bottom:1px solid #CCCCCC;border-right:1px solid #CCCCCC; text-align:center}
</style>
</head>
<body>
<table border="0" width="100%" id="table1">
<tr>
<td>测试1</td>
<td>测试1</td>
<td>测试1</td>
</tr>
<tr style="BACKGROUND-COLOR: #eeeeee;">
<td>测试1</td>
<td>测试1</td>
<td>测试1</td>
</tr>
<tr>
<td>测试1</td>
<td>测试1</td>
<td>测试1</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>测试1</title>
<style>
td {border:none;border-bottom:1px solid #CCCCCC;border-right:1px solid #CCCCCC; text-align:center; }
table {border:none;border:1px solid #000; }
</style>
</head>
<body>
<table border="0" width="100%" id="table1" cellpadding=0 cellspacing=0 >
<tr>
<td>测试1</td>
<td>测试1</td>
<td>测试1</td>
</tr>
<tr style="BACKGROUND-COLOR: #eeeeee;">
<td>测试1</td>
<td>测试1</td>
<td>测试1</td>
</tr>
<tr>
<td>测试1</td>
<td>测试1</td>
<td>测试1</td>
</tr>
</table>
</body>
</html>
------解决方案--------------------
按照7楼的做法是正确的。
你为什么加position:relative,这个东西,在表格里是没有用的。
所以,你所说的top当然也不管用?
你到底想要什么效果那?
------解决方案--------------------
border="1" cellpadding="0" cellspacing="0"
table标签的属性...
------解决方案--------------------
你启用兼容视图看看,在IE工具栏里面
------解决方案--------------------
晕了,说了比较清楚了,
table里的tr和td元素,position选项中,absolute,fixed,relative是没有用的。
所以,请去掉position:relative。
我的机器装的是ie9,但是开ie8模式,你代码显示是正常的,但是在firefox8.0下,显示的效果与你说的相同。
但是只要去掉position:relative,显示就正常了。
------解决方案--------------------