Home  >  Article  >  Web Front-end  >  In FF, there is a lot of data in the inner table, and the lower end exceeds the parent DIv by a large amount. How to adjust it?_html/css_WEB-ITnose

In FF, there is a lot of data in the inner table, and the lower end exceeds the parent DIv by a large amount. How to adjust it?_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:22:361291browse

There is a div with min-height set, and a Table inside to display the records of the database.

Now there are too many records in the table, and the lower end directly exceeds the div by a large margin.

I canceled the min-height setting and increased the height, but there was no effect of automatic adjustment with the table height in IE.

How to adjust it?


Reply to the discussion (solution)

Do you want the height of the div to grow automatically as the content of the table increases?

<!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> 

You need to add a div to the container Div
981352fe48dabc8a19e18cc25d96098b16b28748ea4df4d9c2150843fecfba68

Please see the reason:
http://developer.51cto.com/art/201008/222367.htm

Thank you for your reply.

Set the width and height of the div and then set
overflow:auto;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn