Page 1 of 1

How to display data horizontaly?

Posted: Thu May 21, 2009 4:03 am
by charli18
Hi,
Could anyone please tell me how to display data horizontaly with limited 2 products for each row?

Thanks

Re: How to display data horizontaly?

Posted: Thu May 21, 2009 4:38 am
by jaoudestudios
Can you give a simple example of what you mean?

Re: How to display data horizontaly?

Posted: Thu May 21, 2009 6:19 am
by charli18
For example we have a page that display images from a database but in horizontal.

Like below:


Image1 :D Image2 :D


Image 3 :D Image 4 :D

Re: How to display data horizontaly?

Posted: Thu May 21, 2009 6:24 am
by jaoudestudios
What html are you using? tables/lists?

Re: How to display data horizontaly?

Posted: Thu May 21, 2009 7:52 am
by charli18
table

Re: How to display data horizontaly?

Posted: Thu May 21, 2009 8:15 am
by jaoudestudios

Code: Select all

 
<table>
   <tr>
      <td>1</td>
      <td>2</td>
  </tr>
   <tr>
      <td>3</td>
      <td>4</td>
  </tr>
</table>
 

Re: How to display data horizontaly?

Posted: Thu May 21, 2009 11:00 am
by charli18
I did not ask for HTML.

Re: How to display data horizontaly?

Posted: Thu May 21, 2009 11:05 am
by Benjamin
charli18 wrote:Hi,
Could anyone please tell me how to display data horizontaly with limited 2 products for each row?

Thanks
Looks like your question was answered.

Re: How to display data horizontaly?

Posted: Thu May 21, 2009 11:32 am
by jayshields
The OP worded the original question badly, but what he wants is automatic table generation.

You need a counter which increments for each piece of data, and when the counter is an even number (eg. $counter % 2 == 0) then end the current row and start a new one.