|
Posted by Michael B. Trausch on 07/08/05 22:03
Mike wrote:
> Hello,
> I don't want anyone to write this for me.I just need a nudge.
> I have a Db with links to images that I want to display in a table 5 columns
> wide.I already created the code to add one row to the $NumRecords/5.
> I need to put the records in the table without going back to the beginning
> of the recordset.
> Getting my conditionals and loops in the right order is the problem.
> Any help would be appreciated
> Thanks,
> Mike
>
If you want to display data in a table, and that table is five columns
wide, then I would say that you would need one (outer) loop for the rows
and one (inner) loop for the column pieces.
For example:
for($y = 0; $y <= (($maxUnits / 5) + 1); $y++)
{
// This gets executed for the amount of rows we need. Open
// table row...
echo "<tr>";
for($x = 0; $x <= 5; $x++)
{
echo "<td>";
// Stuff.
echo "</td>";
}
echo "</tr>";
}
That's just one way you can do it, it's about the way I would do it,
however.
Navigation:
[Reply to this message]
|