Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2010
    Location
    RI
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Need some help centering my table please.

    Ive tried a few different ways but it wont budge. Please help.

    Code:
    <!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=utf-8" />
    <title>mods</title>
    <style type="text/css">
    
    </style>
    <link href="myG35.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    
       <div id="wrapper"> 
       <div id="banner"></div>
        <ul id="navbar">      
             <li><a href="homepage.html">Home</a></li>
             <li><a href="mods.html">Mods</a></li>
             <li><a href="Contact.html">Contact</a></li>
             <li><a href="links.html">Links</a></li>
             <li><a href="media.html">Media</a></li>       
          </ul>
          
          <br />
          <br />
        
       <div id="table">
       <table>
         <table width="552" border="1">
          <tr>
            <th></th>
            <td width="185">Description</td>
            <td width="95">Purchase date</td>
            <td width="81">Manufacturer</td>
            <td width="67">Cost</td>
         </tr>
         <tr>
            <th>Front Bumper</th>   
            <td>OEM Nissan &quot;Nismo&quot; Aero bumper</td>
            <td>8/15/2008</td>
            <td>Nissan</td>
            <td>$600</td>
         </tr>
         <tr>
           <th>Rear Bumper</th>
           <td>OEM Nissan &quot;Nismo&quot; rear valance</td>
           <td>8/15/2008</td>
           <td>Nissan</td>
           <td>$235</td>
        </tr>
      <tr>
        <th>Headlights</th>
        <td>OEM Painted Matte black housings</td>
        <td>&nbsp;</td>
        <td>Nissan</td>
        <td>Free</td>
      </tr>
      <tr>
        <th>Corner Lights</th>
        <td>JDM Nissan clear corner lights</td>
        <td>8/20/2007</td>
        <td>Nissan</td>
        <td>$40</td>
      </tr>
      <tr>
        <th>Taillights</th>
        <td>OEM Nissan 05-06 </td>
        <td>6/22/2008</td>
        <td>Nissan</td>
        <td>$320</td>
      </tr>
      <tr>
        <th>Grill</th>
        <td>OEM embelemless Matte black</td>
        <td>&nbsp;</td>
        <td>Nissan</td>
        <td>Free</td>
      </tr>
      <tr>
        <th>Shift knob</th>
        <td>Nismo 6mt shift knob</td>
        <td>6/24/2009</td>
        <td>Nissan</td>
        <td>$110</td>
      </tr>
      <tr>
        <th>Audio</th>
        <td> Touch Screen Double Din</td>
        <td>7/15/2008</td>
        <td>Kenwood</td>
        <td>$1300</td>
      </tr>
      <tr>
        <th></th>
        <td>JDM Double Din Dash Kit</td>
        <td>3/6/2008</td>
        <td>Nissan</td>
        <td>$265</td>
      </tr>
      <tr>
        <th></th>
        <td>6.5&quot; Component Speakers</td>
        <td>5/13/2008</td>
        <td>Polk Audio</td>
        <td>$110</td>
      </tr>
      <tr>
        <th>Sway Bars</th>
        <td>Front and rear adj sway bars</td>
        <td>2/20/2009</td>
        <td>Stillen</td>
        <td>$275</td>
      </tr>
      <tr>
        <th>Brake</th>
        <td>Slotted Rotors</td>
        <td>4/2/2009</td>
        <td>Stop Tech</td>
        <td>$360</td>
      </tr>
      <tr>
        <th></th>
        <td>HPS Brake pads</td>
        <td>4/2/2009</td>
        <td>Hawk</td>
        <td>$55</td>
      </tr>
      <tr>
        <th>Intake</th>
        <td>Rev-up Airbox</td>
        <td>3/14/2009</td>
        <td>Nissan</td>
        <td>$65</td>
      </tr>
      <tr>
        <th></th>
        <td>350z Intake tube</td>
        <td>3/2/2009</td>
        <td>Nissan</td>
        <td>$62</td>
      </tr>
      <tr>
        <th></th>
        <td>5/16&quot; Plenum spacer</td>
        <td>4/2/2009</td>
        <td>Motordyne</td>
        <td>$220</td>
      </tr>
      <tr>
        <th>Exhaust</th>
        <td>G35 Coupe Mid Pipe</td>
        <td>10/30/2007</td>
        <td>Nissan</td>
        <td>Free</td>
      </tr>
      <tr>
        <th></th>
        <td>350Z HR Y-Pipe</td>
        <td>3/2/2009</td>
        <td>Nissan</td>
        <td>$75</td>
      </tr>
      <tr>
        <th>Misc</th>
        <td>Ground Wire Kit</td>
        <td>4/6/2009</td>
        <td>SxExCx</td>
        <td>$93</td>
      </tr>
      <tr>
        <th>Tires</th>
        <td>17&quot; Tires</td>
        <td>3/14/2009</td>
        <td>Falken</td>
        <td>$388</td>
      </tr>
      <tr>
        <th>Suspension</th>
        <td>350z Unrevised Coil Springs</td>
        <td>3/6/2008</td>
        <td>Nissan</td>
        <td>$55</td>
      </tr>
      <tr>
        <th></th>
        <td>Shocks and Struts</td>
        <td>3/6/2008</td>
        <td>Tokico</td>
        <td>$450</td>
      </tr>
      <tr>
        <th></th>
        <td>Rear Adjustable Arms</td>
        <td>3/6/2008</td>
        <td>SPC</td>
        <td>$75</td>
      </tr>
    </table>
    </div>
    
    </div>
    </body>
    </html>
    Here the CSS. I also tried the left and right auto margins but it didn't work either.

    #table {
    background-color: #69Fs;
    display:block;
    margin:0 auto;
    text-align:center;
    border: thick double #000;
    }
    Attached Thumbnails Attached Thumbnails Need some help centering my table please.-table.jpg  

  • #2
    New Coder
    Join Date
    May 2009
    Posts
    74
    Thanks
    0
    Thanked 7 Times in 7 Posts
    Try using the code below:

    <!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=utf-8" />
    <title>mods</title>
    <style type="text/css">
    #table {
    background-color: #69Fs;
    display:block;
    margin:0 auto;
    text-align:center;
    border: thick double #000;
    }
    </style>
    <link href="myG35.css" rel="stylesheet" type="text/css" />
    </head>
    <body>

    <div id="wrapper">
    <div id="banner"></div>
    <ul id="navbar">
    <li><a href="homepage.html">Home</a></li>
    <li><a href="mods.html">Mods</a></li>
    <li><a href="Contact.html">Contact</a></li>
    <li><a href="links.html">Links</a></li>
    <li><a href="media.html">Media</a></li>
    </ul>

    <br />
    <br />

    <div id="table">
    <table width="552" border="1" align="center">
    <tr>
    <th></th>
    <td width="185">Description</td>
    <td width="95">Purchase date</td>
    <td width="81">Manufacturer</td>
    <td width="67">Cost</td>
    </tr>
    <tr>
    <th>Front Bumper</th>
    <td>OEM Nissan &quot;Nismo&quot; Aero bumper</td>
    <td>8/15/2008</td>
    <td>Nissan</td>
    <td>$600</td>
    </tr>
    <tr>
    <th>Rear Bumper</th>
    <td>OEM Nissan &quot;Nismo&quot; rear valance</td>
    <td>8/15/2008</td>
    <td>Nissan</td>
    <td>$235</td>
    </tr>
    <tr>
    <th>Headlights</th>
    <td>OEM Painted Matte black housings</td>
    <td>&nbsp;</td>
    <td>Nissan</td>
    <td>Free</td>
    </tr>
    <tr>
    <th>Corner Lights</th>
    <td>JDM Nissan clear corner lights</td>
    <td>8/20/2007</td>
    <td>Nissan</td>
    <td>$40</td>
    </tr>
    <tr>
    <th>Taillights</th>
    <td>OEM Nissan 05-06 </td>
    <td>6/22/2008</td>
    <td>Nissan</td>
    <td>$320</td>
    </tr>
    <tr>
    <th>Grill</th>
    <td>OEM embelemless Matte black</td>
    <td>&nbsp;</td>
    <td>Nissan</td>
    <td>Free</td>
    </tr>
    <tr>
    <th>Shift knob</th>
    <td>Nismo 6mt shift knob</td>
    <td>6/24/2009</td>
    <td>Nissan</td>
    <td>$110</td>
    </tr>
    <tr>
    <th>Audio</th>
    <td> Touch Screen Double Din</td>
    <td>7/15/2008</td>
    <td>Kenwood</td>
    <td>$1300</td>
    </tr>
    <tr>
    <th></th>
    <td>JDM Double Din Dash Kit</td>
    <td>3/6/2008</td>
    <td>Nissan</td>
    <td>$265</td>
    </tr>
    <tr>
    <th></th>
    <td>6.5&quot; Component Speakers</td>
    <td>5/13/2008</td>
    <td>Polk Audio</td>
    <td>$110</td>
    </tr>
    <tr>
    <th>Sway Bars</th>
    <td>Front and rear adj sway bars</td>
    <td>2/20/2009</td>
    <td>Stillen</td>
    <td>$275</td>
    </tr>
    <tr>
    <th>Brake</th>
    <td>Slotted Rotors</td>
    <td>4/2/2009</td>
    <td>Stop Tech</td>
    <td>$360</td>
    </tr>
    <tr>
    <th></th>
    <td>HPS Brake pads</td>
    <td>4/2/2009</td>
    <td>Hawk</td>
    <td>$55</td>
    </tr>
    <tr>
    <th>Intake</th>
    <td>Rev-up Airbox</td>
    <td>3/14/2009</td>
    <td>Nissan</td>
    <td>$65</td>
    </tr>
    <tr>
    <th></th>
    <td>350z Intake tube</td>
    <td>3/2/2009</td>
    <td>Nissan</td>
    <td>$62</td>
    </tr>
    <tr>
    <th></th>
    <td>5/16&quot; Plenum spacer</td>
    <td>4/2/2009</td>
    <td>Motordyne</td>
    <td>$220</td>
    </tr>
    <tr>
    <th>Exhaust</th>
    <td>G35 Coupe Mid Pipe</td>
    <td>10/30/2007</td>
    <td>Nissan</td>
    <td>Free</td>
    </tr>
    <tr>
    <th></th>
    <td>350Z HR Y-Pipe</td>
    <td>3/2/2009</td>
    <td>Nissan</td>
    <td>$75</td>
    </tr>
    <tr>
    <th>Misc</th>
    <td>Ground Wire Kit</td>
    <td>4/6/2009</td>
    <td>SxExCx</td>
    <td>$93</td>
    </tr>
    <tr>
    <th>Tires</th>
    <td>17&quot; Tires</td>
    <td>3/14/2009</td>
    <td>Falken</td>
    <td>$388</td>
    </tr>
    <tr>
    <th>Suspension</th>
    <td>350z Unrevised Coil Springs</td>
    <td>3/6/2008</td>
    <td>Nissan</td>
    <td>$55</td>
    </tr>
    <tr>
    <th></th>
    <td>Shocks and Struts</td>
    <td>3/6/2008</td>
    <td>Tokico</td>
    <td>$450</td>
    </tr>
    <tr>
    <th></th>
    <td>Rear Adjustable Arms</td>
    <td>3/6/2008</td>
    <td>SPC</td>
    <td>$75</td>
    </tr>
    </table>
    </div>

    </div>

    </body>
    </html>


    Regards.


  •  

    Posting Permissions

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