bryndyment
03-30-2003, 03:03 AM
Hi,
I've retrieved some values from a DB, and want to display them in a table. The data is sorted alphabetically in an array, and I want the results to appear as follows (two columns):
A F
B G
C H
D I
E J
I want each value to be in its own cell. What's a good programmatic way to build a table, since it kinda wants me to finish each ROW in its entirety before moving on? (Wheras I want to build the <td> for "A", then for "B", since I'm iterating through my loop... it would be hard to build the <td> for "A", then for "F", then for "B"... etc.)
In other words, it would be trivial to contruct the following:
A B
C D
E F
G H
I J
But what's a cool way to build a column-centric table, rather than row-centric?
Hope I've described it well (enough).
I've retrieved some values from a DB, and want to display them in a table. The data is sorted alphabetically in an array, and I want the results to appear as follows (two columns):
A F
B G
C H
D I
E J
I want each value to be in its own cell. What's a good programmatic way to build a table, since it kinda wants me to finish each ROW in its entirety before moving on? (Wheras I want to build the <td> for "A", then for "B", since I'm iterating through my loop... it would be hard to build the <td> for "A", then for "F", then for "B"... etc.)
In other words, it would be trivial to contruct the following:
A B
C D
E F
G H
I J
But what's a cool way to build a column-centric table, rather than row-centric?
Hope I've described it well (enough).