Re: loop in horizontal direction (php-html)

From: Date: Thu, 10 Aug 2006 15:39:59 +0000
Subject: Re: loop in horizontal direction (php-html)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-240469@lists.php.net to get a copy of this message
Reinhart Viane wrote:
Hey, 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 ... 1 45 89 5 8 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
If I understand your question.. Simply use a foreach() for each <tr>, and include another foreach(), inside the <tr> foreach(), for each <td>. <td>s don't need to be terminated with </td>s

« previous php.general (#240469) next »