...

View Full Version : making table



juslai
01-13-2013, 09:30 AM
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

sunfighter
01-13-2013, 02:02 PM
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.

juslai
01-13-2013, 03:49 PM
i already got the php part any examples for using if on the tables?

linek98
01-14-2013, 02:18 AM
Here is some nasty and ugly 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>';

?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum