Re: How do I return 3 results and print </tr>
- From: Alvaro G Vicario <alvaro_QUITAR_REMOVE@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 May 2005 17:06:10 +0200
*** Aaron Reimann wrote/escribió (31 May 2005 07:55:35 -0700):
> I am trying to build a table using results from a database query.
> Right now (code below), the code displays each result in a new <tr>. I
> am wanted to display 3 results in one <tr> </tr>, and then create a new
> <tr> with another 3, etc.
$position=0;
while( ... ){
if($position==0){
echo '<tr>';
}
echo '<td>' . $data . '</td>';
if($position==2){
echo '</tr>';
}
$position=($position+1) % 3;
}
We leave completing last line as an exercise for the reader ;-)
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
.
- References:
- How do I return 3 results and print </tr>
- From: Aaron Reimann
- How do I return 3 results and print </tr>
- Prev by Date: How do I return 3 results and print </tr>
- Next by Date: phpldapadmin faile to create courier email account
- Previous by thread: How do I return 3 results and print </tr>
- Next by thread: Re: How do I return 3 results and print </tr>
- Index(es):
Relevant Pages
|