Loading ...
Sorry, an error occurred while loading the content.

XHTML table centering...

Expand Messages
  • Gordon Stewart
    Hello... I have a little problem - Basically, I have a website (not online / public as yet).... - which i want the main wording in the title to be centered...
    Message 1 of 1 , Sep 6, 2009
    • 0 Attachment
      Hello...

      I have a little problem -

      Basically, I have a website (not online / public as yet).... - which i
      want the main wording in the title to be centered...

      I've played with the colours - only to see what I'm doing & see which
      part is doing what...

      The below code is the batre basics - I've stripped away all the
      unnecessary code...

      i have 3 words in the RED box - I want that mini-table to be CENTERED
      within the box it is contained in, However i cannot make this work..
      It always appeared left-aligned... - IE the red box to be centered
      within the outer TD field

      am I missing something obvious ? Or am I mis-interpreting the table
      centre command in CSS & using 'text align' inappropriately ?

      ( I've googled & all the examples use TEXT ALIGN etc.... .. )

      Ps - it DOES validate as correct XHTML... - Also, these are mot the
      final colours - I just wanted to see what the tables are doing.....

      Thank you....

      Gordon. (see below for HTML 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>
      </head>
      <body>
      <table class="header-background" style="border: double 5px;
      width: 100%; padding: 2px">
      <tr>
      <td>
      <table style="border: 25px; width: 100%;
      border-spacing: 5px; border-color:BLUE; padding: 2px">
      <tr style="background-color: white">
      <td style="width: 1%">
      IMAGE

      </td>
      <td style="text-align: center;
      vertical-align: middle">

      <div style="text-align:center">
      <table style="border-style:solid;
      border-width:1px; border-color:red; text-align:center">
      <tr>
      <td style="font-size:250%;
      color:#2AA475">WORD1</td>
      <td style="font-size:250%;
      color:#CCFFCC">WORD2</td>
      <td style="font-size:250%;
      color:#2AA475">WORD3</td>
      </tr>
      </table>
      </div>

      <br /><br />
      <a href='/about'>About us</a>
        -  
      <a href='/safety'>Safety Notice / Disclaimer</a>
      </td>
      <td style="width: 1%; text-align: right;
      vertical-align: middle;" rowspan='2'>

      <div style="color:white">
      Main Areas
      </div>
      <br />

      </td>
      </tr>
      </table>
      </td>
      </tr>
      </table>
      </body>
      </html>





      --
      G
      Freecycle Auckland :-
      http://www.freecycle.org/
    Your message has been successfully submitted and would be delivered to recipients shortly.