Welcome to WebmasterWorld Guest from 54.146.171.44

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Formatting PHP table

   
2:46 am on Dec 22, 2006 (gmt 0)

10+ Year Member



How do I format the output from a query? Specifically, I have the following code this works...

...
<td>$id</td>\n
...

but this does not---
...
<span style="font-variant: small-caps">
<font color="#0000FF">$id</font></td>\n

any ideas on how I would be able to fromat the output of my query?

3:11 am on Dec 22, 2006 (gmt 0)

10+ Year Member



This might have something to do with single and double quotes, but it's hard to tell.

In other words:

echo "<td>$id</td>\n";

would work o.k. But for the second one you might have to do something like:

echo '<span style="font-variant: small-caps">';
echo "<font color='#0000FF'>$id</font></td>\n";

Notice the single and double quotes...

3:45 am on Dec 22, 2006 (gmt 0)

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 5+ Year Member



Yes, that is most likely the problem. More on this here [us2.php.net]. :)
10:51 am on Dec 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



instead of using

echo '<span style="font-variant: small-caps">';
echo "<font color=\"#0000FF\">$id</font></td>\n"

I recommend you use css:

echo "<td class=\"td_id\">$id</td>\n";

Merry Xmas
Michal Cibor

2:32 pm on Dec 22, 2006 (gmt 0)

10+ Year Member



thanks all!

Happy Holidays to all - this forum is great!