DIV not stretching

They have: 2 posts

Joined: May 2006

I have a table inside a div container but as the table grows larger that the div container the div container doesn't grow with it! Can anyone help me with this? I've attached an image of what happens in firefox!

This doesn't happen in ie! Just firefox!

[ATTACH]223[/ATTACH]

AttachmentSize
untitled.jpg60.05 KB
timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

I seem to recall that happening to me once before. The workaround I arrived at (if memory serves) was to put this after the table:

<p>&nbsp;</p>'
Let me know how that works.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Oh yes, this is a very common problem with DIVs.

What you are really needing is just a block level element (such as what tim suggested above).

Another work around would be (but more verbose):

.spacer {
clear:both;
}

There is also another way, which is to set overflow:hidden; in the containing DIV.

They have: 2 posts

Joined: May 2006

Cheers guys! They both work great!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.