Align Center Question

Discussion in 'HTML & Website Design' started by crazyhorse, Jun 1, 2005.

  1. #1
    I would like to center my images and my Google ad in my index_body.tpl file.

    At the moment the code looks like this :

    What would be best to do, divide it up in two different tables or?
     
    crazyhorse, Jun 1, 2005 IP
  2. JoeO

    JoeO Peon

    Messages:
    431
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you just want to center them in the table?

    If so just use <td align="center">

    *edit*
    oh if you want to center all your image td's you can do something like this:

    <tr>

    <td align="center" colspan="4">

    <table><tr>
    <td width="182"><img src="http://www.domain.nl/forum/images/n770_cs.jpg"></td>
    <td width="182"><img src="http://www.domain.nl/forum/images/n70_pm_cs.jpg"></td>
    <td width="182"><img src="http://www.domain.nl/forum/images/n90_pm_cs.jpg"></td>
    <td width="182"><img src="http://www.domain.nl/forum/images/n91_pm_cs.jpg"></td>
    </tr></table>

    </td>
    </tr>
    <tr>
     
    JoeO, Jun 1, 2005 IP
  3. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ok but how to align the google ad as well? Same kind of idea. Or all in one table?
     
    crazyhorse, Jun 1, 2005 IP
  4. JoeO

    JoeO Peon

    Messages:
    431
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yup same thing just do:

    <td colspan="4" align="center">
    <script type="text/javascript"><!--
    google_ad_client = "google id";
    google_ad_width = 728;
    google_ad_height = 90;
    google_ad_format = "728x90_as";
    google_ad_type = "text";
    google_color_border = "F4F6FB";
    google_color_bg = "F4F6FB";
    google_color_link = "000066";
    google_color_url = "000000";
    google_color_text = "222222";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    </td>
     
    JoeO, Jun 1, 2005 IP
  5. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I have tried it but that doesnt work they dont align to the middle.
     
    crazyhorse, Jun 1, 2005 IP
  6. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I often get that too. Try <div align='center'>ads here</div> as well.
     
    T0PS3O, Jun 1, 2005 IP
  7. JoeO

    JoeO Peon

    Messages:
    431
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I've tried it and it works, if you want to center each image in its respective TD you can use the following code (If you are looking to center the whole table on the page just use <center></center> around the entire table):

     
    JoeO, Jun 1, 2005 IP
  8. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks for the responses. Still cant get it to work. I will let someone look at it. Maybe there is already a table in there that might cause the problem. BTW im using phpbb not sure if that is of any difference?
     
    crazyhorse, Jun 1, 2005 IP
  9. JoeO

    JoeO Peon

    Messages:
    431
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I've never used phpbb, but I do not see why that would make a difference as long as there is no broken code on the page. If you want to send me the page I can take a look at it for you.
     
    JoeO, Jun 1, 2005 IP
  10. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Yeah that would be great if you would like to do so. ;)
     
    crazyhorse, Jun 1, 2005 IP
  11. JoeO

    JoeO Peon

    Messages:
    431
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Sure no problem. I just pm'd you my email address.
     
    JoeO, Jun 1, 2005 IP
    crazyhorse likes this.
  12. crazyhorse

    crazyhorse Peon

    Messages:
    1,137
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Got your pm thanks . Email send. Much appreciated.
     
    crazyhorse, Jun 1, 2005 IP
  13. whitebmw

    whitebmw Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    <p align="center">PUT EVERYTHING HERE!</p>
     
    whitebmw, Nov 12, 2006 IP