Problem with tables

Discussion in 'Web Design and Development' started by JBaker122586, Mar 4, 2008.

  1. JBaker122586 macrumors 65816

    Joined:
    Jun 21, 2007
    #1
    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.
     
  2. Eraserhead macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #2
    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.
     
  3. JBaker122586 thread starter macrumors 65816

    Joined:
    Jun 21, 2007
    #3
    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.
     
  4. Eraserhead macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #4
    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.

    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 :).
     
  5. JBaker122586 thread starter macrumors 65816

    Joined:
    Jun 21, 2007
    #5
    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.
     

Share This Page