Page 1 of 1

Newbie display two columns

Posted: Sun Apr 06, 2008 8:04 pm
by rzen
Hi. I would like to know where i can find materials or tutorials regarding this specific issue.
I want the output from my database to be displayed in two columns, where each of the displayed results will have the picture, title and the content (all of them are stored in the database). I have managed to display one record per row, but i think it will be more practical to show two articles(products or whatever) per row. Its a little frustrating because all the websites I'm analyzing are using this kind of display and I don't know how to do it and I can't find how is this done.

Re: Newbie display two columns

Posted: Sun Apr 06, 2008 9:18 pm
by Christopher
The concept is that you have an integer counter variable that you increment at the end of each loop. In the loop you check to see if the counter is equal to the number of columns you want. If it is you start a new row and set the counter back to its start value (e.g. 1).

Re: Newbie display two columns

Posted: Mon Apr 07, 2008 2:11 pm
by rzen
Thanks a lot for the answer! It helped :D