| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Resident Cheese Expert
Join Date: Aug 2006
Location: South Wales
Posts: 485
|
Table falling out of div
Hi there, I've been producing an application with PHP, and have used CSS for the styling. I had a form, and to make it look a little better (aligned) I have used a table. First of all, I hope this isn't a bad thing to do. I know tables should only be used for tabular data. Also, since I've put the form into a table, and its jumped out of the div (see picture) that its supposed to be inside. No idea why as it was fine when it was just the form on its own. ![]() Any ideas? Thanks |
|
|
|
|
|
#4 (permalink) |
|
knocking heads
Join Date: Jul 2003
Location: London, UK
Posts: 1,902
|
as you start working on more complex layouts you'll find the clear:both style quite useful. Best thing is to create a class called ".clearer" and just reuse as needed. I find that in most sites I do I have to put a .clearer div at the bottom of the wrapper div in order to make the container stretch beyond the last element. I've never looked into the reason behind why it does it, as I just found it to work. I assume it's something to do with not defining a height for a div that has nested divs inside of it so it just assumes the height is the height of the content contained within that first div, so for example: Code:
so you add the clearer div to force the first div to take into account the nested contents height... clear as mud |
|
|
|
#7 (permalink) |
|
knocking heads
Join Date: Jul 2003
Location: London, UK
Posts: 1,902
|
actually, just noticed for the first time that hes got a meat cleaver in his head and hes being served as dinner... for the past umpteen months ive glanced at that pic and seen it as a man with his head coming out of a toilet bowl.. dont ask! |
|
|
|
#8 (permalink) |
|
Resident Cheese Expert
Join Date: Aug 2006
Location: South Wales
Posts: 485
|
Thanks for the words of advice. Its little pieces like this that can really make a difference. God knows I'm finding it hard enough learning new things whilst trying to pass a University degree course, in which they like to teach at least 40% bollocks and nonsense. |
|
![]() |