Re: Table trouble
| From: | phpu | Date: | Mon, 07 Jul 2003 22:42:48 +0000 |
| Subject: | Re: Table trouble | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154272@lists.php.net to get a copy of this message | ||
10x but i am new to php and i do not know how to dump all of the results
into an array.... can you help me with this one please?
----- Original Message -----
From: "Kevin Stone" <kevin@helpelf.com>
To: "phpu" <phpu@go.ro>; <php-general@lists.php.net>
Sent: Tuesday, July 08, 2003 1:19 AM
Subject: Re: [PHP] Table trouble
> I'd just dump all of the results into an array and do something like this:
>
> echo "<table border=1>\n";
> for($i=0; $i<count($array);)
> {
> echo "\t<tr>\n";
> for($j=0; $j<2; $j++)
> {
> echo "\t\t<td>".$array[$i]."</td>\n";
> $i++;
> }
> echo "\t</tr>\n";
> }
> echo "</table>\n";
>
> On odd numbered arrays you'll end up with an empty cell. Most browsers
will
> handel the empty cell by simply not displaying it. Others might show the
> box. It's a minor cosmetic thing but if you want it to look consistent
then
> test for that situation and add a non-breaking space to the final cell.
>
> HTH,
> Kevin
>
> ----- Original Message -----
> From: "phpu" <phpu@go.ro>
> To: <php-general@lists.php.net>
> Sent: Monday, July 07, 2003 4:03 PM
> Subject: [PHP] Table trouble
>
>
> Hello
> I need help.
> I'm querying a database then printing the results in a table. I want the
> result to be in a table with 2 columns per row.
> something like that
>
> --------------------------------------------------------
> -- -- --
> -- row 1 -- row 2 --
> -- -- --
> --------------------------------------------------------
> -- -- --
> -- row 3 -- row 4 --
> -- -- --
> --------------------------------------------------------
> -- -- --
> -- row 5 -- row 6 --
> -- -- --
> --------------------------------------------------------
> and so on.....
>
> How can I do that?
> Please help me asap
>
>
>
>
>