Re: CSS and variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> $newcolor = "color: red";
>
> <td style= "<? echo($newcolor): ?>">'.$row[1].'</td>
>
> But it doesn't work. No problem with th "spacer" class, works fine. I just
> can't get the syntax for pulling a CSS style from a PHP var.

You could do this:

<?php
    $newcolor = 'red';
    echo "<td style=\"{$newcolor}\">{$row[1]}</td>";
?>

-- 
Richard Heyes
HTML5 graphing: RGraph - www.rgraph.net (updated 14th November)
Lots of PHP and Javascript code - http://www.phpguru.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux