Hi to all.
I'm new to php and I need to know how to change background color basic on condition:
backcg="y"
If (backcg="y")
{background blue}
else
{default background}
thanks in advance
Need Simple way to change backcolor?
Moderator: General Moderators
Re: Need Simple way to change backcolor?
background colour of what?.... body, table, table row, field, etc, etc... several choices... for me, the easy way is using CSSgertrudis wrote:Hi to all.
I'm new to php and I need to know how to change background color basic on condition:
backcg="y"
If (backcg="y")
{background blue}
else
{default background}
thanks in advance
Re: Need Simple way to change backcolor?
Background of body and fonts
Re: Need Simple way to change backcolor?
CSS... either using a main container (wrapper) or using different colour schemas...
here you can get an idea
http://www.lateralcode.com/alternate-colors-php/
Miko
here you can get an idea
http://www.lateralcode.com/alternate-colors-php/
Miko
Re: Need Simple way to change backcolor?
This is something I did for table rows whilst printing an array.
I have two styles in the CSS, .hilite1 and .hilite2:
This was using data from a postgres DB, hence the pg_fetch_array.
I have two styles in the CSS, .hilite1 and .hilite2:
Code: Select all
$hilite = 1;
while ($row = pg_fetch_array($result)) {
// Jump out of PHP for a while
?>
<tr class="trHiLite<?php echo $hilite;?>">
<td><?php echo $row['zonerp_cs'];?></td>
</tr>
<?php
if ($hilite == 2){
$hilite--;
}
else{
$hilite++;
}
}