Erik
Erik

Reputation: 5791

Why won't my div expand to accommodate my table?

I have a dynamic table that expands in height at various times. It's wrapped in a DIV tag. The DIV tag does not expand with the table. Is there a trick to fix this?

Upvotes: 0

Views: 1598

Answers (2)

Jason Gennaro
Jason Gennaro

Reputation: 34855

Without seeing any code, it sounds like you needs a clearing br under the table.

Add <br style="clear:both;" /> after the table and before the closing </div>.

Of course, you should place that CSS in a class and add it to your stylesheet.

Upvotes: 2

blast_hardcheese
blast_hardcheese

Reputation: 454

Have you tried setting the width and height on the div to auto? Some brief googling seems to suggest that position also needs to be set, so either position:absolute or position:relative should work fine.

I can revise my answer if you post either code or a link to the page you're having the problem on.

#yourDiv
{
  position:absolute;
  width:auto;
  height:auto;
}

Upvotes: -1

Related Questions