super thx Parl hat gefuntzt,
wie bekomme ich das nun hin das die unter 15 refs rot angezeigt werden?
super thx Parl hat gefuntzt,
wie bekomme ich das nun hin das die unter 15 refs rot angezeigt werden?
in:PHP-Code:<?
for($x=1;$x<11;$x++){
if (!isset($users[$x])) $users[$x] = 'n/a';
if (!isset($ref[$x])) $ref[$x] = 0;
$row = ($rp % 2 == 0) ? 0 : 1; ?>
<tr class="tr_row<?=$row;?>">
<td align="right"><?=$rp++;?>. </td>
<td> <?=$users[$x];?></td>
<td align="right"><?=$ref[$x];?> </td>
<td align="right"><?=number_format($ralleydaten['p'.$x], 0).' '.$waehrung;?> </td>
</tr>
<?
} ?>
PHP-Code:<?
for($x=1;$x<11;$x++){
if (!isset($users[$x])) $users[$x] = 'n/a';
if (!isset($ref[$x])) $ref[$x] = 0;
$style = ($ref[$x] < 15) ? 'color:red;' : '' ;
$row = ($rp % 2 == 0) ? 0 : 1; ?>
<tr class="tr_row<?=$row;?>" style="<?=$style;?>">
<td align="right"><?=$rp++;?>. </td>
<td> <?=$users[$x];?></td>
<td align="right"><?=$ref[$x];?> </td>
<td align="right"><?=number_format($ralleydaten['p'.$x], 0).' '.$waehrung;?> </td>
</tr>
<?
} ?>
Kill one man, and you are a murderer.
Kill millions of men, and you are a conqueror.
Kill them all, and you are a god. - Jean Rostand, Thoughts of a Biologist (1939)
Ok, weil die TD's den Style überschreiben, also dann bspw. so:
Aber sehr unschön so gelöst, soll nur als Denkanstoss dienenPHP-Code:<?
for($x=1;$x<11;$x++){
if (!isset($users[$x])) $users[$x] = 'n/a';
if (!isset($ref[$x])) $ref[$x] = 0;
$style = ($ref[$x] < 15) ? 'color:red;' : '' ;
$row = ($rp % 2 == 0) ? 0 : 1; ?>
<tr class="tr_row<?=$row;?>" >
<td align="right" style="<?=$style;?>"><?=$rp++;?>. </td>
<td style="<?=$style;?>"> <?=$users[$x];?></td>
<td align="right" style="<?=$style;?>"><?=$ref[$x];?> </td>
<td align="right" style="<?=$style;?>"><?=number_format($ralleydaten['p'.$x], 0).' '.$waehrung;?> </td>
</tr>
<?
} ?>![]()
Kill one man, and you are a murderer.
Kill millions of men, and you are a conqueror.
Kill them all, and you are a god. - Jean Rostand, Thoughts of a Biologist (1939)