/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<? if($bgcolor == '#FFFFFF')$bgcolor = '#F5F5F5'; else $bgcolor = '#FFFFFF'; ?> ---- <? $vector = array("ar.gif", "cl.gif", "co.gif", "cr.gif", "do.gif", "es.gif", "mx.gif", "pe.gif", "ve.gif"); $vector2 = array("Argentina", "Chile", "Colombia", "Costa Rica", "República Dominicana", "España", "Méjico", "Perú", "Venezuela"); if($bgcolor == '#FFFFFF')$bgcolor = '#F5F5F5'; else $bgcolor = '#FFFFFF'; echo ' <tr> <td width="100%" bgcolor="'.$bgcolor.'"><img src="'.$vector[$i].'"> '.$vector2[$i].'</td> </tr> '; } ?>
URL: http://www.webtaller.com/construccion/lenguajes/php/lecciones/colorear-tablas-datos-en-php.php