CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 18th, 2002, 05:58 PM
mrhague mrhague is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Posts: 10 mrhague User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 47 sec
Reputation Power: 0
Unhappy Formatting Output in Table using Printf and CSS

As you may guess, I am new to PHP and am experiencing some frustration with attempting to format data in a table. Here is my statement for the first row of the table, which contains the statement :

printf ('<td width=\"192\" height=\"14\" valign=\"top\" class=\"Header1\"><a href="%s">%s</a></td>', "$PHP_SELF?sort=dept_sort", "Department");

Problem is, the reference to the Class does not work. I get no errors, but the font does not get formatted as Header1. I have tried various iterations of this using <Span> outside of the <Td> tag to set the font, etc., but nothing seems to work. The font does not get set to the style in Header1. I have spent hours on this - can someone help me? Is there a better way to do this?

Thanks!

Marcie

Reply With Quote
  #2  
Old June 18th, 2002, 06:35 PM
SilkySmooth's Avatar
SilkySmooth SilkySmooth is offline
Newbie :P
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2001
Location: In the PHP Engine :-)
Posts: 2,880 SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level)SilkySmooth User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 11 h 18 m 3 sec
Reputation Power: 15
Hi Marcie,

I have never really used CSS with PHP but I have a suggestion you might want to try.

Rather than print it all in PHP try exiting PHP into HTML and then re-entering PHP, like so...

PHP Code:
<?
// Lots of other loverly PHP code here
?>
<td width="192" height="14" valign="top" class="Header1">
<?
printf 
('<a href="%s">%s</a></td>'"$PHP_SELF sort=dept_sort""Department"); 
?>


Just an idea
__________________
---------------------
-- SilkySmooth --
---------------------
Directory Share | Free phpLD Mods | Little Directory

Reply With Quote
  #3  
Old June 19th, 2002, 10:29 AM
mrhague mrhague is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Posts: 10 mrhague User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 47 sec
Reputation Power: 0
It Works!

Thanks Ade,

Your solution worked just great! I'm finding that there are many different ways to do things in PHP!

Marcie

Reply With Quote
  #4  
Old June 21st, 2002, 11:36 AM
rtaylor rtaylor is offline
Chretien & Trudeau gone - Good
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Location: In a multi-cultural mess of failed peace-keepers.
Posts: 567 rtaylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 43 sec
Reputation Power: 8
marcie,

You might as well apply SilkySmooth's idea to both lines
of code. Drop the printf.
PHP Code:
 ?>
<td width="192" height="14" valign="top" class="Header1">
<?
printf_
('<a href="%s">%s</a></td>',_"$PHP_SELF_sort=dept_sort",_"Department");
?> 

as in
PHP Code:
 ?>
<td width="192" height="14" valign="top" class="Header1">
<a href="<?=$PHP_SELF?>?sort=dept_sort">Department</a></td>
?> 

Hope this helps,
Robert
__________________
Robert
---
If it's hard, it's probably wrong.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Formatting Output in Table using Printf and CSS


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway