You are here: Re: How do I line up SQL query results 3 across the page? « PHP Programming Language « IT news, forums, messages
Re: How do I line up SQL query results 3 across the page?

Posted by John Meyer on 12/23/05 18:09

skinnybloke wrote:

> Hi - can anybody point me to a tutorial to do the following:
>
>
> I am running a SQL SELECT statement which returns the URL addresses of
> images which when clicked on will link to another page - no problem in
> doing that.
>
> What I am having difficulty in is lining these up in a html table 3
> images across the page.
>
> i.e.
>
> <table>
> <tr>
> <td>image</td>
> <td>image</td>
> <td>image</td>
> </tr>
> <tr>
> <td>image</td>
> <td>image</td>
> <td>image</td>
> </tr>
> </table>
>
> Any help would be appreciated.


The modulus operator in the while loop you're fetching the results in works
wonders. Basically, set up a counter, check to see if the counter modulus
3 = 0. If it does, break off that row and start a new one.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация