Welcome to WebmasterWorld Guest from 54.234.63.220

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Formatting PHP table

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

Junior Member

10+ Year Member

joined:Sept 1, 2004
posts:158
votes: 0


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)

Full Member

10+ Year Member

joined:Jan 5, 2004
posts:202
votes: 0


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)

Senior Member

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

joined:Nov 12, 2005
posts:5966
votes: 0


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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 26, 2003
posts:1133
votes: 0


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)

Junior Member

10+ Year Member

joined:Sept 1, 2004
posts:158
votes: 0


thanks all!

Happy Holidays to all - this forum is great!

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members