Connecting Tech Pros Worldwide Help | Site Map

Multiple-row table formatting of results

  #1  
Old July 17th, 2005, 02:09 AM
Daniel Ruscoe
Guest
 
Posts: n/a
Hi all,

This is probably a simple one if you know what you're doing, but I could
use some code to work from.

I'd like to write a script that will take a single key value from rows
in a MySQL database and place each key value into it's own cell in a
table.

Each row of the table needs to be only five cells across before moving
onto the next row.

How, in PHP, can I create a HTML table that will automatically move to
the next row after five cells are filled?

Many thanks in advance.

- Daniel
  #2  
Old July 17th, 2005, 02:09 AM
Michael Fuhr
Guest
 
Posts: n/a

re: Multiple-row table formatting of results


Daniel Ruscoe <contact@website.plz> writes:
[color=blue]
> I'd like to write a script that will take a single key value from rows
> in a MySQL database and place each key value into it's own cell in a
> table.
>
> Each row of the table needs to be only five cells across before moving
> onto the next row.
>
> How, in PHP, can I create a HTML table that will automatically move to
> the next row after five cells are filled?[/color]

Work on the problem incrementally: leave MySQL out of the picture
until you've solved the table problem. The data source is irrelevant.

Maintain a variable that you increment each time you fill a cell.
When the number hits five, it's time to end the current row and
start a new one. Either reset the cell counter each time you start
a new row or use the modulus (%) operator when you check it.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2000: Filter from Queried results Wes Dabney answers 1 November 12th, 2005 05:17 PM
MS Access Question / Multiple Find and Replace Based on Another Table Daniel answers 2 November 12th, 2005 04:18 PM
Impact of images on load performance Ben Long answers 5 July 24th, 2005 12:42 AM
Recommended decent XML editor? I kind of desperately need one. Mike Kamermans answers 7 July 20th, 2005 08:36 AM
Unification of Methods and Functions David MacQuigg answers 99 July 18th, 2005 12:28 PM