Reply to Re: Dynamic Table

Your name:

Reply:


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.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация