这是我的 html:
<table id='first' width="800" border="0" cellpadding="0"> <!-- first table -->
<tr>
<td width="323">
<img src="../imageOne.jpg" width="323" height="179" alt="" />
</td>
<td width="257">
<table id='second'> <!-- table inside table -->
<tr>
<td><img src="../imageTwo.jpg" alt="CSS logo" width="190" height="100" /></td>
</tr>
<tr>
<td><br /><img src="../imageThree.jpg" alt="ESA logo" width="190" height="95" /></td>
</tr>
</table> <!-- end second table. This second table had two rows / two images, one on top of another. -->
</td>
<td width="212"><img src="../imageFour.jpg" width="203" height="251" alt="photo of an extension cord plugged in" /></td>
</tr>
</table>
这实际上不是我的 html,我在工作并且必须编辑其他人。 如您所见,表中有表。在IE8中,第二个表格在第一个表格里面,但是在IE10中由于某些原因,第二个表格在第一个表格的下方。就好像第二张表有一个
margin-top: 20px;
但我确保表格没有边距。知道为什么第二个表不是内联/完全在第一个表内吗? 注意:此网页位于内部网站上。
编辑:我在想,如果我能找到一种在第一个表格内垂直对齐表格的方法,也许就可以解决问题?有没有办法在另一个表格中垂直对齐一个表格?
最佳答案
几乎可以肯定您遇到了兼容模式问题:
点击工具 -> 兼容查看设置
取消选中“在兼容性 View 中显示 Intranet 站点”
出于超出我想象的原因,Microsoft 认为默认情况下 Intranet 站点应该以“兼容性 View ”模式呈现,这基本上意味着 IE 呈现引擎的早期版本(我相信它一直追溯到 IE7)。
http://windows.microsoft.com/en-CA/internet-explorer/use-compatibility-view#ie=ie-11
您可能还想查看此元标记和您需要在 web.config 中设置的 header ,详见此 SO 帖子:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
X-UA-Compatible is set to IE=edge, but it still doesn't stop Compatibility Mode
关于HTML - IE10 无法正确显示表格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20956666/