Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-13-2013, 08:30 AM   PM User | #1
juslai
New Coder

 
Join Date: Jul 2012
Location: Philippines
Posts: 35
Thanks: 5
Thanked 0 Times in 0 Posts
juslai is an unknown quantity at this point
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..
juslai is offline   Reply With Quote
Old 01-13-2013, 01:02 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,387
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
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.
sunfighter is offline   Reply With Quote
Old 01-13-2013, 02:49 PM   PM User | #3
juslai
New Coder

 
Join Date: Jul 2012
Location: Philippines
Posts: 35
Thanks: 5
Thanked 0 Times in 0 Posts
juslai is an unknown quantity at this point
i already got the php part any examples for using if on the tables?
juslai is offline   Reply With Quote
Old 01-14-2013, 01:18 AM   PM User | #4
linek98
New Coder

 
Join Date: Dec 2012
Location: England
Posts: 18
Thanks: 0
Thanked 4 Times in 4 Posts
linek98 is an unknown quantity at this point
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>';

?>
linek98 is offline   Reply With Quote
Users who have thanked linek98 for this post:
juslai (01-14-2013)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:03 PM.


Advertisement
Log in to turn off these ads.