Re: Text Color
| From: | Jim Lucas | Date: | Fri, 29 Feb 2008 04:17:20 +0000 |
| Subject: | Re: Text Color | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-270694@lists.php.net to get a copy of this message | ||
Jeff wrote:
Please, can anyone tell me how to produce colored text? For instance if I wanted to following code to be printed as red text what would I need to add to they code? Thanks in advance. echo "<TR><TD>".$myrow["char_name"]."<TD>".$myrow["char_level"]."<TD>".$class["class"]."<TD>".$myrow["kara"]."<TD>".$myrow["karateam"]."<TD>".$myrow["karasub"];To the example code, nothing. But, you could add a CSS entry that would do the trick. <style> td { color: red; } </style> This would make ALL <td ...> tags have a red font color. If you wanted, you could add a class attribute to the <td ...> tag and only effect the table cells that you intend. <style> .highlight { color: red; } </style> <?php echo "<TR> <TD class='highlight'>{$myrow['char_name']}</td> <TD class='highlight'>{$myrow['char_level']}</td> <TD class='highlight'>{$class['class']}</td> <TD class='highlight'>{$myrow['kara']}</td> <TD class='highlight'>{$myrow['karateam']}</td> <TD class='highlight'>{$myrow['karasub']}</td> </tr>"; ?>