溢出:隐藏在表内不起作用

Mar*_*ark 5 html css hidden overflow

当我尝试下面的代码时,隐藏溢出不起作用(它扩展):

<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1024" height="100" colspan="3">&nbsp;</td>
  </tr>
  <tr><td width="1024">
    <div style="width:1024;height:436;overflow:hidden;">
    <div style="position:absolute;">
    <table border="0" cellpadding="0" cellspacing="0"><tr>
    <td width="51"><img src="images/page1_04.jpg" width="51" height="436" /></td>
    <td width="922" height="437"><img src="images/page1_05.jpg" width="922" height="436" /></td>
    <td width="51"><img src="images/page1_06.jpg" width="51" height="436" onMouseOver="this.src='images/hover/page1_arrow_hover_06.jpg'" onMouseOut="this.src='images/page1_06.jpg'" /></td>
    <td width="300"><img src="images/page2_05.jpg" /></td>
    <td width="51"><img src="images/page2_04.jpg" width="51" height="436"  onMouseOver="this.src='images/hover/page2_arrow_hover_04.jpg'" onMouseOut="this.src='images/page2_04.jpg'" /></td>
    <td width="922" height="437"><img src="images/page2_05.jpg" width="922" height="436" /></td>
    <td width="51"><img src="images/page2_06.jpg" width="51" height="436" /></td>
    </tr></table>
    </div>
    </div>
    </td>
  </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

但是,当我只使用代码的一个片段(父div)时,它工作正常.

我究竟做错了什么?

马克,提前谢谢你.

小智 6

您需要table-layout:fixed; along with overflow:hidden;在table元素上设置样式.