Re: loop in horizontal direction (php-html)

From: Date: Thu, 10 Aug 2006 20:32:07 +0000
Subject: Re: loop in horizontal direction (php-html)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-240499@lists.php.net to get a copy of this message
On Thu, August 10, 2006 8:32 am, Reinhart Viane wrote: > I've been wondering. > I know it's possible to make a php loop that each time generates a new > <tr>. > In that case the results are stored under eachother. > Now I want to know if I can do the same in a horizontal direction. > > The result should be something like this, I loop through available > projects: > > Project1 Project2 Project3 Project4 ... $item_count = 0; while (... = mysql_result($result)){ if (($item_count % 5) == 0) echo "<tr>\n"; $item_count++; echo "<td>$project_id</td>\n"; > 1 45 89 5 8 if (($item_count % 5) == 4) echo "</tr>\n"; } > 2 23 9 65 31 > 3 23 91 55 73 > 4 11 90 82 38 > > > The first column is fixed, but I have an unkown amount of projects > > Hope this aint to much html related. > > Thanks in advance, > Reinhart Viane > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#240499) next »