topmargin=0 ? (bringing a table up)

Discussion in 'HTML & Website Design' started by 8everything, May 10, 2007.

  1. #1
    To bring a table up to the very top, which codes do you use that's compliant with HTML 4.0 transitional.. OR XHTML 1.0 transitional? (I'm mainly looking for an HTML one).

    I've tried
    <body topmargin="0"> but it says that it's invalid yet it shows the results I want..

    Thanks.
     
    8everything, May 10, 2007 IP
  2. Arnold9000

    Arnold9000 Peon

    Messages:
    241
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Here is the XHTML way to do it

    <style>
    body {
    top-margin: 0px;
    }
    </style>

    Now that you have styled your body tag, you can use it normally

    <body>
    </body>


    you can also set the margins of the other side the same way by just replace "top" with "bottom" or "right" or "left"


    Here is the HTML way to do it

    <body marginheight="0" topmargin="0">

    Marginheight and topmargin are both the same thing. Topmargin will show up as invalid, but I've found it keeps IE happy. Otherwise, marginheight is what your looking for.
     
    Arnold9000, May 10, 2007 IP
    8everything likes this.
  3. 8everything

    8everything Peon

    Messages:
    16,350
    Likes Received:
    903
    Best Answers:
    0
    Trophy Points:
    0
    #3
    marginheight="0"

    This was the attribute that I was missing. Thanks :D
     
    8everything, May 11, 2007 IP