homepage Welcome to WebmasterWorld Guest from 23.23.12.202
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Formatting PHP table
dave1236

10+ Year Member



 
Msg#: 3196779 posted 2:46 am on Dec 22, 2006 (gmt 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?

 

rover

10+ Year Member



 
Msg#: 3196779 posted 3:11 am on Dec 22, 2006 (gmt 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...

eelixduppy

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



 
Msg#: 3196779 posted 3:45 am on Dec 22, 2006 (gmt 0)

Yes, that is most likely the problem. More on this here [us2.php.net]. :)

mcibor

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3196779 posted 10:51 am on Dec 22, 2006 (gmt 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

dave1236

10+ Year Member



 
Msg#: 3196779 posted 2:32 pm on Dec 22, 2006 (gmt 0)

thanks all!

Happy Holidays to all - this forum is great!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved