Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JBaker122586

macrumors 65816
Original poster
Jun 21, 2007
1,379
125
I have my css set up so the margins float it over away from the edge of the page.
However, whenever I try and insert a table in my html document, it seems to ignore this.

Here's an example. Just posting an image:
www.brandnewstreet.com/pictures/index2.html

And here, I put the image in a table:
www.brandnewstreet.com/pictures/index3.html


I'm trying to make an image gallery on the page, so it's kind of important that I can use a table and get it to be in the middle of my page.

Thanks for the help.
 
You shouldn't embed the table in a paragraph of text, and should stick the margin stuff in the welcome block of the CSS not the p block.

FWIW your html looks really clear, but your CSS could do with a tidy. You would also be better off sizing with em rather than px.
 
If I put the margin in the welcome block of the css rather than the p block, it will cause the light gray to not stretch for the entire width of the content block.

I did get it fixed by just posting the table in the h3 block.

And yeah, I originally took the html and css from a template, which I decided stunk and chose to just edit forever rather than re-write from scratch. That's why it's a bit messy.
 
You aren't using the HTML correctly if you do that. The p and h3 are to be applied to titles and paragraphs of text and should only be used for that. You'll have problems down the line getting it to work in different browsers if you aren't careful ;).

In this situation The light gray colour should be applied to the "container" div, and the dark grey should be apply to body so then it shouldn't be a problem.

And yeah, I originally took the html and css from a template, which I decided stunk and chose to just edit forever rather than re-write from scratch. That's why it's a bit messy.

I just think a few sensibly place line breaks in the CSS and removing redundant elements which have no properties would be worthwhile, just to make it more readable :).
 
Thanks a lot for the help.
I didn't begin doing anything in html or css until about 5 days ago. So, yeah, I'm still really new and beginning to learn all this junk.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.