FF中,内层Table数据多,下端超出了父DIv一大截该怎么调整?_html/css_WEB-ITnose

WBOY
풀어 주다: 2016-06-24 12:22:36
원래의
1293명이 탐색했습니다.

有一个div,设置了min-height,内部有一个Table显示数据库的记录.

现在table里记录数过多,下端直接超出div一大截.

我取消min-height设置,增加height,但都没有IE里随table高度自动调整的效果.

请问该怎么调整下?


回复讨论(解决方案)

你把想div的高度随表格内容的高动自动增长吗?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head></head><body><div style="width:100px; height:auto;background-color:#ccc;">	<table width="252" border="0" cellspacing="0" cellpadding="1">  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>aa</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>aa</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td> </td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr>  <tr>    <td>a</td>    <td> </td>    <td> </td>    <td> </td>  </tr></table></div></body></html> 
로그인 후 복사

需要在容器Div中加一个div

 

理由请见:
http://developer.51cto.com/art/201008/222367.htm

谢谢回帖的同事.

div设置好宽高然后,设置
overflow:auto;

원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿