-----Original Message-----
From: Sheila Fenelon [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 29, 2004 8:35 AM
To: [EMAIL PROTECTED]
Subject: [wdvltalk] Re: php and css tables

Trusz, Andrew wrote:
> What does turn out to
> work is just to drop the quotes in the embedded style sheet. So both of
> these work:
> 
> <table width="$main_table_width" align="center" valign="center" 
>       border="0" cellspacing="0" cellpadding="1"
> bgcolor="$main_table_border_color">
> 
> and:
> 
> <style type="text/css">
> table{border:1px solid  $main_table_border_color;
>                text-align:center;width:600px;  margin-left:auto;
> margin-right:auto;}
> </style>
> 
> I remain confused as to why quotes and not quotes. I do understand why
echo
> doesn't work. 

Without seeing more of the script I can only assume that it uses the 
HEREDOC syntax to output HTML
http://us4.php.net/manual/en/language.types.string.php#language.types.string
.syntax.heredoc

Something like

echo <<<STYLE
  <style type="text/css">
  table{border:1px solid  $main_table_border_color;
                 text-align:center;width:600px;  margin-left:auto;
  margin-right:auto;}
  </style>
STYLE;

echo <<<HTML
<table width="$main_table_width" align="center" valign="center"
        border="0" cellspacing="0" cellpadding="1"
  bgcolor="$main_table_border_color">
HTML;


With HEREDOCs, the variables are interpreted and the values they store 
are echoed. Whether quotes are needed or not needed depends on the 
syntax rules for HTML. In the style sheet they are not used and in the 
table tag they are not strictly required or could be single quotes. 
Placing quotes in the style definition breaks the syntax rules for 
HTML/CSS.


Sheila


Yep it uses HERE. And if any of these messages actually do get posted today
(running almost 3 hrs behind when I wrote the last one before it was posted
-- problem at our end not wdvl) you'll see I remembered what an attribute is
so I've figured out the why of it. 

You taught me better than that, I just don't always remember as well or in a
timely fashion.

drew

____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set 
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to