Results 1 to 3 of 3

Thread: Centering table in Dreamweaver

  1. #1
    Join Date
    Oct 2007
    Posts
    46
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Centering table in Dreamweaver

    I'm trying to center a table in Dreamweaver and can get it to centre horizontally but not vertically. Vertically, it remains at the top of the browser window and I can't seem to figure out how to make it center in both directions. I'm trying to accomplish something like this site http://www.keirsurgical.com/ where the table is centered in both height and width regardless of screen size. I'm using Dreamweaver CS3.

    Thanks in advance.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    i think what you are talking about is the little background gray over the links?
    that isnt centering, that is padding around the elements.

    Code:
    <ul id="nav">
         <li><a href="/url/path">Link</a></li>
         <li><a href="/url/path">Link</a></li>
         <li><a href="/url/path">Link</a></li>
         <li><a href="/url/path">Link</a></li>
         <li><a href="/url/path">Link</a></li>
    </ul>
    Code:
    <style type="text/css">
    ul#nav {
         width: 100%;
    }
    ul#nav li {
         list-style: none;
         display: inline;
         background-color: #hexadecimal;  /* eg#ffffff for white */
         color: #hexadecimal /* text color */
    }
    ul#nav li a {
         display: block;
         color: inherit;
         text-decoration: none;
    }
    ul#nav li a:hover {
          background-color: #hexadecimal;  /* change the color of background on hover */
          text-decoration: underline;
    }
    </style>

  3. #3
    Join Date
    Oct 2007
    Posts
    46
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Thanks Boogeyman but I'm actually looking to center my entire website onscreen. Most websites are centered but located at the top of the browser window but this one (and a few others I've seen) are actually completely centered within the browser window - no matter how the window is sized. So, the screen space around the webpages is equal all the way around. I have a 21" monitor so when I preview my site, it is fine horizontally within the browser window but vertically, it stays at the top of the window and I don't know how to change that. I hope this makes sense. Any other ideas?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •