SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Tables ??

  1. #1
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    Denmark
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Tables ??

    I have created a little script that makes sure that there is maximum 3 links in each row.
    The only problem i have is that the row is only finished every time there is 3 links in each row :-(

    So if i have 5 links its like this

    <tr><td>LINK1</td><td>LINK2</td><td>LINK3</td></tr>
    <tr><td>LINK4</td><td>LINK5</td>

    so now i have a row that isnīt closed ??? Does anybody have a solution or dosnīt it matter if the tag isnīt closed in this case. It looks fine in the browser but i can imagine that it is not good practise to do this.

    PHP Code:

    $c 
    0

    while (
    $joke mysql_fetch_array($jokes)) { 

              
    $id $joke['ID']; 
           
    $links $joke['headline']; 
          
    $email $joke['EMail']; 
        
    $author $joke['AID']; 
         
    $image $joke['Name']; 
          
    $c++; 



    if ( 
    $c == ) { 
    echo 
    "<tr>\n"



    echo 
    "<td><a href=\"joke.php?id=$id\"><strong>$LINKS</strong></a></td>"

    // Desides how many rows there has to be in each cell // 

    if ( $c == ) { 

    echo 
    "\n</tr>\n\n"
    $c 0





  2. #2
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Abo2512,

    I already posted a solution for you at post #6 on this thread:

    http://www.sitepointforums.com/showt...hreadid=105951
    John

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    Denmark
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I forgot to thank you John. It was a good script you gave me :-)

  4. #4
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem. Glad you got it!
    John


Bookmarks

Posting Permissions

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