Re: Creating a Table to line query results in php?

From: Date: Thu, 01 Mar 2007 13:41:43 +0000
Subject: Re: Creating a Table to line query results in php?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-43138@lists.php.net to get a copy of this message
You could also just use CSS. Make each column in a div and line them up that way. Might not be as simple as a table right off-the-bat, but if you have to make any changes later, its often easier. A quick google search shows tons of tutorials on tables in css. http://css.nu/articles/table-in-css.html "Scott" <sburcky@gmail.com> wrote in message news:c96bd0160702250352q15e0b18fob823c681a7e756e7@mail.gmail.com... > Hi everyone! > > How can I create a table...or even something similar...to line information > up? > > The information is coming from an mysql database and there are 5 > columns of data. > > Of course I am using php to call the data out of the database. > > A simple example: > > while ($data = mysql_fetch_array($res)) > { > $idfield = $data['IDFIELD']; > $name = $data['Name']; > $effect = $data['Effect']; > $category = $data['Category']; > $origin = $data['Origin']; > $image = $data['Image']; > > echo "<img src=\"image/$image\">, $name, $effect, $category, > $origin<br>"; > } > > The echo is the stuff I want to line up under the headings of the > columns when they are displayed. > > So there are 5 headers and under the 5 headers is the resulting > display of info and I want it lined up, centered, under the headers. > > Does that all make sense? > > Thanks for all of your time! > > S

« previous php.db (#43138) next »