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 5 of 5

Thread: align..problem

  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    align..problem

    Hello again

    im trying to align in center some rows of this table..

    PHP Code:
    $result_array[] = "<a href='index.php?cid=$cid&pid=".$row[0]."'><img src='".$images_dir."/tb_".$row[2]."' border='0' alt='".$row[1]."' />
                            <td><a href='index.php?cid=$cid&pid="
    .$row[0]."'>".$row[1]."</td>
                            <td><a href='index.php?cid=$cid&pid="
    .$row[0]."'>".$year substr($row[3],0,4)."/".$month substr($row[3],4,2)."/".$day substr($row[3],6,2)."</td>
                            <td><p><a href='index.php?cid=$cid&pid="
    .$row[0]."'>$day/$month/$year</a></p>
                                <p><a href='index.php?cid=$cid&pid="
    .$row[0]."'>$countdown</p></td>
                            <td><a href='index.php?cid=$cid&pid="
    .$row[0]."'>$countdown</td>
                            </a>"

    and i try this

    PHP Code:
    <td><div align="center"><a href='index.php?cid=$cid&pid=".$row[0]."'>$countdown</a></div></td
    what im doing wrong?? i dont understand

  • #2
    New Coder
    Join Date
    Jan 2005
    Location
    Iowa City
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This really should be in the HTML & CSS forum, as the fact that your using PHP has nothing to do with the problem. However, all you need to do is give the td the align='center' attribute, and it will work fine.

    Div's will always take up the maximum width of their container (in this case the td) unless given a width with CSS. Therefor the align on the div doesn't make sence, because it is taking up the entire width.

    If you want to keep the div, use:
    Code:
    <div style='text-align:center;'></div>
    and this should also do the trick.
    PS - this is what part of the alphabet would look like if Q and R were eliminated.

  • #3
    New Coder
    Join Date
    Nov 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thnx Redoc

    Thnx friend..is working...
    and now a dump question

    where can i find infos about the use of (div,td,tr..etc)???

  • #4
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    "$question = ( to() ) ? be() : ~be();"

  • #5
    New Coder
    Join Date
    Nov 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thnx

    Thnx


  •  

    Posting Permissions

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