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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2005
    Posts
    663
    Thanks
    5
    Thanked 14 Times in 14 Posts

    Need Help with printing multiple rows

    I'm trying to print a table that has between 2 - 8 columns (ie, <td> 's) in it.

    If the row has 4 columns I want it to do nothing. But if it has 5 or 6 columns, I want it to break into two rows of 3 and 2 (or 3 and 3), and if it has 7 or 8 columns, it should break it into rows of 4 and 3 (or 4 and 4).

    I have the following code here to determine how many columns I have:
    PHP Code:
    if (($numplayers == 5) || ($numplayers == 6))
        { 
    $break 3;    }
        else if ((
    $numplayers == 7) || ($numplayers == 8))
        { 
    $break 4;    }
        else
        { 
    $break = -1; } 
    But I'm not sure how to proceed and insert the break into the ending </tr> of a column and to so start a new row.

    Or is there a better approach?

    Can anyone help with that?

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    663
    Thanks
    5
    Thanked 14 Times in 14 Posts
    small bump, as I'm back to looking to get this implementd.

    Can anyone help?


  •  

    Posting Permissions

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