【发布时间】:2014-05-18 06:35:21
【问题描述】:
这是我见过的最奇怪的事情之一, 我在表格单元格中有一个表格,其中包含隐藏的输入。 我注意到在 IE7 中,一旦隐藏输入超过 1 个,单元格就会展开。
这是一个屏幕截图(说三个但也有两个):
这是 HTML:
<table border="1" class="fix">
<col style="width:150px;" />
<col style="width:200px;" />
<col style="width:200px;" />
<col style="width:200px;" />
<col style="width:190px;" />
<tr>
<td class="cell"></td>
<td class="cell"></td>
<td class="cell"><form action="a.php" method="GET">
<input name="a" type="hidden" value="1"/>
<input name="b" type="hidden" value="2"/>
<div class="button-zone"><input type="submit" class="button" value="ABCDEF GEHIJKLM"></div></form></td>
<td class="cell"></td>
<td class="cell"></td>
</tr>
</table>
一旦我删除输入 b 行(我需要),单元格看起来很正常。
这是 CSS:
table.fix {
table-layout: fixed;
}
table.fix td {
overflow: hidden;
}
td {
padding: .31em 1em 2em 1em;
text-align: left;
}
.cell {
background-color: gray;
padding-bottom: 12px;
padding-left: .44em;
}
.button-zone {
float: left;
margin-left: 0px;
position: relative;
}
.button {
background-color: yellow;
font-family: Arial;
font-weight: bold;
color: black;
border: 0;
overflow: visible;
font-size: 16px;
padding: 4px 20px 4px 8px;
}
IE7 上会出现这种情况,有什么方法可以在不修改大小的情况下解决这个问题?
【问题讨论】:
标签: html css internet-explorer cross-browser internet-explorer-7