ie的table宽度问题

cloudgamer 2008-09-10 02:36:36
[code=BatchFile]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>

<table border="1" cellspacing="1" width="600">
<tr>
<td width="100" align="right"> 上传位置: </td>
<td> 上传位置上传位置上传位置 </td>
</tr>
<tr>
<td colspan="2"> 温馨提示:温馨提示 温馨提示 温馨提示 温馨提示 </td>
</tr>
</table>
<br /><br />
<table border="1" cellspacing="1" width="600">
<tr>
<td width="100" align="right"> 正常正常:</td>
<td> 上传位置上传位置上传位置 </td>
</tr>
<tr>
<td colspan="2"> 温馨提示:温馨提示 温馨提示 温馨提示 </td>
</tr>
</table>


</body>
</html>[/code]

ff是正常的
但用ie看会发现第一个table会无端多出一段空白
最糟的是影响到结构
怎么解决啊!
...全文
190 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
cloudgamer 2008-09-10
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 iooview_onemoon 的回复:]
给 table 定义 { table-layout: fixed; }

未定义时,单元格宽度会按内容宽度的比例自动调整。
[/Quote]

太好了
ghostkngiht 2008-09-10
  • 打赏
  • 举报
回复

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>

<table border="1" cellspacing="1" width="600">
<tr>
<td width="17%" align="right"> 上传位置: </td>
<td> 上传位置上传位置上传位置 </td>
</tr>
<tr>
<td width="83%" colspan="2"> 温馨提示:温馨提示 温馨提示 温馨提示 温馨提示 </td>
</tr>
</table>
<br /><br />
<table border="1" cellspacing="1" width="600">
<tr>
<td width="17%" align="right"> 正常正常:</td>
<td> 上传位置上传位置上传位置 </td>
</tr>
<tr>
<td width="83%" colspan="2"> 温馨提示:温馨提示 温馨提示 温馨提示 </td>
</tr>
</table>


</body>
</html>

iooview_onemoon 2008-09-10
  • 打赏
  • 举报
回复
给 table 定义 { table-layout: fixed; }

未定义时,单元格宽度会按内容宽度的比例自动调整。
cloudgamer 2008-09-10
  • 打赏
  • 举报
回复
百分比的话就会有的大有的小
看来是没办法了
郁闷啊
Tommy_Tommy 2008-09-10
  • 打赏
  • 举报
回复
width用百分比,就不会出现这些问题
cloudgamer 2008-09-10
  • 打赏
  • 举报
回复
但右边不能定死它
因为实际应用中是用100%
右边也不确定是多少的
Tommy_Tommy 2008-09-10
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>

<table border="1" cellspacing="1" width="600">
<tr>
<td width="100" align="right"> 上传位置:</td>
<td width="500">上传位置上传位置上传位置 </td>
</tr>
<tr>
<td colspan="2"> 温馨提示:温馨提示 温馨提示 温馨提示 温馨提示 </td>
</tr>
</table>
<br /><br />
<table border="1" cellspacing="1" width="600">
<tr>
<td width="100" align="right"> 正常正常:</td>
<td> 上传位置上传位置上传位置 </td>
</tr>
<tr>
<td colspan="2"> 温馨提示:温馨提示 温馨提示 温馨提示 </td>
</tr>
</table>


</body>
</html>
cloudgamer 2008-09-10
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<table border="1" cellspacing="1" cellpadding="1" width="600">
<tr>
<td width="100" align="right"> 后面空了: </td>
<td> 内容内容内容内容内容内容内容 </td>
</tr>
<tr>
<td colspan="2"> 温馨提示:温馨提示 温馨提示 温馨提示 温馨提示 </td>
</tr>
</table>
<br /><br />
<table border="1" cellspacing="1" cellpadding="1" width="600">
<tr>
<td width="100" align="right"> 后面空了: </td>
<td> 内容内容 </td>
</tr>
<tr>
<td colspan="2"> 温馨提示:温馨提示 温馨提示 温馨提示 温馨提示 </td>
</tr>
</table>
<br /><br />
<table border="1" cellspacing="1" cellpadding="1" width="600">
<tr>
<td width="100" align="right"> 正常正常:</td>
<td> 内容内容内容内容内容内容内容 </td>
</tr>
<tr>
<td colspan="2"> 温馨提示:温馨提示 温馨提示 温馨提示 </td>
</tr>
</table>
</body>
</html>


又多一个情况
郁闷啊
busymj 2008-09-10
  • 打赏
  • 举报
回复

确实是这样,真是奇怪喔。
现在要出门了,迟些帮你看看。
  • 打赏
  • 举报
回复
<table border="0" width="600" cellpadding="0" cellspacing="0">
1. HTML对象获取问题 3 2. const问题 3 3. event.x与event.y问题 3 4. window.location.href问题 3 5. frame问题 3 6. 模态和非模态窗口问题 3 7. firefox与IE的父元素(parentElement)的区别 3 8. document.formName.item(”itemName”) 问题 3 9. 集合类对象问题 3 10. 自定义属性问题 3 11. input.type属性问题 3 12. event.srcElement问题 3 13. body载入问题 3 14. 事件委托方法 3 15. Table操作问题 3 16. 对象宽高赋值问题 3 Ø CSS 3 1. cursor:hand VS cursor:pointer 3 2. innerText在IE中能正常工作,但在FireFox中却不行. 3 3. CSS透明 3 4. css中的width和padding 3 5. FF和IE BOX模型解释不一致导致相差2px 3 6. IE5 和IE6的BOX解释不一致 3 7. ul和ol列表缩进问题 3 8. 元素水平居中问题 3 9. Div的垂直居中问题 3 10. margin加倍的问题 3 11. IE与宽度和高度的问题 3 12. 页面的最小宽度 3 13. DIV浮动IE文本产生3象素的bug 3 14. IE捉迷藏的问题 3 15. float的div闭合;清除浮动;自适应高度 3 16. 高度不适应 3 17. IE6下图片下有空隙产生 3 18. 对齐文本与文本输入框 3 19. LI中内容超过长度后以省略号显示 3 20. 为什么web标准中IE无法设置滚动条颜色了 3 21. 为什么无法定义1px左右高度的容器 3 22. 链接(a标签)的边框与背景 3 23. 超链接访问过后hover样式就不出现的问题 3 24. FORM标签 3 25. 属性选择器(这个不能算是兼容,是隐藏css的一个bug) 3 26. 为什么FF下文本无法撑开容器的高度 3

61,110

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧