How to display data horizontaly?
Moderator: General Moderators
How to display data horizontaly?
Hi,
Could anyone please tell me how to display data horizontaly with limited 2 products for each row?
Thanks
Could anyone please tell me how to display data horizontaly with limited 2 products for each row?
Thanks
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: How to display data horizontaly?
Can you give a simple example of what you mean?
Re: How to display data horizontaly?
For example we have a page that display images from a database but in horizontal.
Like below:
Image1
Image2
Image 3
Image 4 
Like below:
Image1
Image 3
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: How to display data horizontaly?
What html are you using? tables/lists?
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: How to display data horizontaly?
Code: Select all
<table>
<tr>
<td>1</td>
<td>2</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</table>
Last edited by Benjamin on Thu May 21, 2009 8:44 am, edited 1 time in total.
Reason: Changed code type from text to html.
Reason: Changed code type from text to html.
Re: How to display data horizontaly?
I did not ask for HTML.
Re: How to display data horizontaly?
Looks like your question was answered.charli18 wrote:Hi,
Could anyone please tell me how to display data horizontaly with limited 2 products for each row?
Thanks
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: How to display data horizontaly?
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.
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.