#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    47
    Rep Power
    4

    Why is "Body" all the way to the right?


    The table is at 100% / center. Iíve even tried right, left, and no change.

    Im using Dreamweaver CS4 and when I save the file ďSave AsĒ it centers it, but when test in my browser, itís to the right.

    What is going on?
    Thanks,
    Scotty
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,399
    Rep Power
    594
    I can see a couple of problems. The first is that this appears to be in the wrong forum. It sounds like an HTML problem to me (I've requested a mod move it). Second, at least in this forum, there are very few clairvoyants. With no code posted I don't even know how the HTML folks can help you.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    47
    Rep Power
    4
    The code I had a month ago is exactly the same code today. Last month it wasnít a problem. Thatís why I didnít post a code.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,399
    Rep Power
    594
    Sorry but I didn't see the code a month ago either.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    47
    Rep Power
    4
    <?php
    include_once("scripts/checkuserlog.php");
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="Description" content="Airline Network" />
    <meta name="Keywords" content="about, us, my, global, pnr, social, network, airline, employees, around, world, globe, global, my, global, PNR, social, network, about, reservations, locator, depart, ckin, announcing, announce, vacation, photos, dest, postcard, rent, home, blog, forum, books, travel, work, trip, reservation, book, exchange, organizer" />
    <meta name="rating" content="General" />
    <meta name="ROBOTS" content="All" />
    <title>About Us at My Global PNR</title>
    <link href="style/main.css" rel="stylesheet" type="text/css" />
    <link rel="icon" href="favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <style type="text/css">
    <!--
    .boldtext {
    font-weight: bold;
    font-size: 36px;
    }
    body
    {
    background-image:url('images/bgaboutus.jpg'); background-position:center top;
    background-repeat:no-repeat;
    }

    -->
    </style>
    </head>

    <body>
    <?php include_once 'mgpheader_template.php'; ?>
    <table class="mainBodyTable" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td width="836" valign="top">
    <div align="right">
    <table width="100%" align="right" cellpadding="6">
    <tr>



    <td width="100%"><p align="left">Welcome Aboard,
    <p align="left">&nbsp;</p>
    <p align="left">Wonít you take a few moments to make a reservation on the newest, most exciting new social network on the web? Enjoy the ease of navigating the siteís clever pages and share your love of the airline industry with other ticketed members? - Membership is free, so why not? </p>
    </p>

    <p align="left">We'll see you onboard,</p> </p>
    <p align="left">&nbsp;</p></td>
    </tr>
    </table>
    </div></td>
    <td width="160" valign="top"><?php include_once "right_AD_template.php"; ?></td>
    </tr>
    </table>
    <?php include_once "footer_template.php"; ?>
    </body>
    </html>
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    9
    Rep Power
    0
    Good evening,

    It's better not to use tables for layout purposes.
    The easiest way to center content on a screen is to create a container div, assign it a width and then set its margins to auto using "margin: 0 auto".

    Here's a simple template to demonstrate what I mean.
    You should quite easily be able to adapt it to your purposes:

    HTML Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Template demonstrating CSS centering</title>
    <style type="text/css">
    body {
    	background: #42413C;
    	margin: 0;
    	padding: 0;
    	color: #000;
    }
     
    .container {
    	width: 960px;
    	background: #FFF;
    	margin: 0 auto; 
    }
     
    .content {
    	padding: 10px;
    }
    </style>
    </head>
     
    <body>
     
    <div class="container">
      <div class="content">
        <h1>Heading</h1>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 
          quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum 
          dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        </p>
        <!-- end .content --></div>
      <!-- end .container --></div>
    </body>
    </html>


    If you have any questions to this, feel free to ask.
  12. #7
  13. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Location
    Ludhiana
    Posts
    33
    Rep Power
    0
    You've defined its alignment to the right...Have you tried margin:0 auto; ? that should help your body to be centralized

IMN logo majestic logo threadwatch logo seochat tools logo