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

Thread: making table

  1. #1
    New Coder
    Join Date
    Jul 2012
    Location
    Philippines
    Posts
    35
    Thanks
    5
    Thanked 0 Times in 0 Posts

    making table

    anybody know how to make a table that has limited rows and when the data inside that is gonna be put into the table exceeds the limit of rows then the next data that will be put in another table next to the old table for example



    TABLE1 || TABLE2 || TABLE n+1
    Data1 || Data6 || Data n+1
    Data2 || Data7 || Data n+1
    Data3 || Data8 || Data n+1
    Data4 || Data9 || Data n+1
    Data5 || Data10 || Data n+1
    Last edited by juslai; 01-13-2013 at 08:34 AM.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,348
    Thanks
    23
    Thanked 618 Times in 617 Posts
    Your page has to be rendered using a server side language such as php and the generation of the tables should be controlled via an IF statement.

    If data is greater than this (Data5); make a new table.

  • #3
    New Coder
    Join Date
    Jul 2012
    Location
    Philippines
    Posts
    35
    Thanks
    5
    Thanked 0 Times in 0 Posts
    i already got the php part any examples for using if on the tables?

  • #4
    New Coder
    Join Date
    Dec 2012
    Location
    England
    Posts
    20
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Here is some nasty and ugly code:
    PHP Code:
    <?php

    $counter 
    0;
    $limit 5;

    echo 
    '<table style="float: left;">';
    for (
    $i 0$i 30$i++) { // example of loop that has 30 rows to be printed
      
    if ($counter >= $limit) {
        
    $counter 0;
        echo 
    '</table><table style="float: left;">';
      }
      echo 
    '<tr><td>Data'.$i.'</td></tr>';
      
    $counter++;
    }
    echo 
    '</table>';

    ?>

  • Users who have thanked linek98 for this post:

    juslai (01-14-2013)


  •  

    Posting Permissions

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