<?PHP
$i = 0;
while($row = mysql_fetch_assoc($result)) {
$i++;
?>
<?PHP
if($i== 5) {
echo '<tr>';
}
?>
<td class="right bottom"><?PHP echo $row['GridID']; ?></td>
<td class="right bottom"> </td>
<td class="right bottom"> </td>
<td class="right bottom"> </td>
<td class="bottom"> </td>
<?PHP
if($i== 5) {
echo '</tr>';
$i=0;
}
?>
Create a new row every when $i = 5
#1
Posted 02 February 2013 - 10:00 AM
#2
Posted 02 February 2013 - 10:23 AM
#3
Posted 02 February 2013 - 10:34 AM
How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq
Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!
#4
Posted 02 February 2013 - 11:33 AM
echo "<div style='width:200px'>\n";
for ($i=1; $i<=25; $i++) {
echo "<div style='width:20%; float:left; text-align:center; border:1px solid gray;'>
$i
</div>";
}
echo "</div>\n";
|
|baaGrid| easy data tables - and more |
#5
Posted 02 February 2013 - 11:47 AM
#6
Posted 02 February 2013 - 12:06 PM
echo "<table border='1' style='width:200px; border-collapse:collapse;'>\n";
echo "<tr>";
for ($i=1; $i<=25; $i++) {
echo "<td style='text-align:center; '>
$i
</td>";
if ($i%5==0)
echo "</tr><tr>";
}
echo "</tr></table>\n";
Edited by Barand, 02 February 2013 - 12:07 PM.
|
|baaGrid| easy data tables - and more |
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












