SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jan 2014
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Having trouble to auto center a page

    Hi everyone,

    I was just wondering if any of you be kind enough to look at this site and tell me how to auto center this site. I am managing this site but not an uber expert of CSS

    Thank you a bunch

    http://danielsjewelers.com/

    Henry

  2. #2
    SitePoint Addict deadmix's Avatar
    Join Date
    Jun 2009
    Location
    france
    Posts
    210
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    hello there,

    open your index page, in the code source, just after the <body class, there is this code for the first table :

    <table border="0" cellpadding="0" cellspacing="0" width="1000px">

    Replace it with :

    <table border="0" cellpadding="0" cellspacing="0" width="1000px" align="center">

    Goodluck

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,165
    Mentioned
    453 Post(s)
    Tagged
    8 Thread(s)
    Hi hanklebow76. Welcome to the forums.

    That's pretty easy to do, but it's worth noting here that table layouts like this are very outdated, and not recommended any more.

    Quote Originally Posted by deadmix View Post
    align="center">
    That's one option, but it's a bit out of date. Better to use CSS centering here. Ideally, you'd add a class to the table and then target it in a CSS file. But a quick and dirty option is to do this:

    Code:
    <table border="0" cellpadding="0" cellspacing="0" width="1000px" style="margin:  0 auto;">

  4. #4
    SitePoint Addict deadmix's Avatar
    Join Date
    Jun 2009
    Location
    france
    Posts
    210
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    hello Ralph.m

    in fact i just gave the simple way to do this as he said he don't know much about CSS.

    The website structure is oldies.. use a lot of tables... so that's why i think the solution of align="center" is the simple way to do that!


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
  •