Anyone help me to center in php?

Discussion in 'Programming' started by colinph970, Jun 26, 2010.

  1. #1
    I've a banner which is added to a page using the following code



    <?php if (function_exists(show_rotator())) { show_rotator(); } ?>



    but this does not center align the banner on the page, instead it left aligns, take a look:

    http://nicheblogsales.com/banner-rotator/

    Its the flashing left aligned banner which I want to align as per the static one just above it.



    Anyone know what code I need to add to make it do this?
     
    colinph970, Jun 26, 2010 IP
  2. nice.wallpapers

    nice.wallpapers Active Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Hi,

    You can write this code :)
    <?php
    print "<center>";
    if (function_exists(show_rotator())) { show_rotator(); }
    print "</center>";
    ?>

    Thanks,
     
    nice.wallpapers, Jun 26, 2010 IP
  3. ryandanielt

    ryandanielt Well-Known Member

    Messages:
    1,797
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    185
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #3
    You can not center anything in PHP, centering is part of styling which is done using either html or css. Next time just use the html <center> Your code here </center> above and below your code.
     
    ryandanielt, Jun 26, 2010 IP
  4. colinph970

    colinph970 Active Member

    Messages:
    410
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    68
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    colinph970, Jun 26, 2010 IP