Posted by Toby Inkster on 03/12/06 21:18
patrick_woflian wrote:
> Hey, i have set up a website which allows users to search for other
> members. This code is in php and works fine, however.. to make the
> layout more attractive i was thinking of using html code segments to
> position the results in a table for example.
How about something like this?
print "<table>\n";
while ($row = mysql_fetch_row($result))
{
$class = ($class=='a')?'b':'a';
$line = implode('</td><td>', $row);
$line = "<tr class=\"$class\"><td>$line</td></tr>\n";
}
print "</table>\n";
with this:
<style type="text/css">
TABLE { border: 2px solid; border-collpase: collapse; }
TR.a TD { color: black; background: #eee; border: 1px solid; }
TR.c TD { color: black; background: #ffd; border: 1px solid; }
</style>
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
[Back to original message]
|