Re: loop in horizontal direction (php-html)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux