Re: de nuevo impresion

From: Date: Wed, 10 Mar 2004 10:55:21 +0000
Subject: Re: de nuevo impresion
References: 1 2 3 4  Groups: php.general.es 
Request: Send a blank email to general-es+get-46424@lists.php.net to get a copy of this message
y qué tal poner: En el head: <style> td.claro{background-color:white;} td.oscuro{background-color:#cccccc;} </style> $clase="claro"; foreach ($news as $line_num => $newsline) { $clase=($clase==claro)?"oscuro":"claro"; echo '<tr class='.$clase.'" ><td><p>'; echo $newsline; echo '<br></p></td></tr>'; } echo '</tbody></table>'; echo '<td class="'.$clase.'">; ><p>'; ----- Original Message ----- From: "Mario Ramirez" <mario_ramirez@fjcorona.com.mx> To: "Lopez, Kaleb (GEAE, Foreign National, CIAT)" <kaleb.lopez@ae.ge.com>; "Php-Es (E-mail)" <php-es@lists.php.net> Sent: Tuesday, March 09, 2004 10:21 AM Subject: Re: [PHP-ES] alternar fondos | prueba de esta manera a ver quetal te funciona... te mando tu codigo con la | linea de codigo que te sugiero. | | $news = file ('http://aepd.mtc.ge.com/portal/test/news.inc'); | echo '<table width:"75%" border="0" bordercolor="black" cellspacing="1" | cellpadding="1"><tbody>'; | | foreach ($news as $line_num => $newsline) { | | echo (($i++%2)==0)? "<tr>" : "<tr background-color=blue>"; | | echo '<td style="background-color: rgb('.$tcolor.');"><p>'; | echo $newsline; | echo '<br></p></td></tr>'; | } | echo '</tbody></table>'; | | | ----- Original Message ----- | From: "Lopez, Kaleb (GEAE, Foreign National, CIAT)" <kaleb.lopez@ae.ge.com> | To: "Php-Es (E-mail)" <php-es@lists.php.net> | Sent: Tuesday, March 09, 2004 3:04 PM | Subject: [PHP-ES] alternar fondos | | | > Hola, Lista. | > | > Estoy creando un desplegado con contenido que leo de un archivo usando la | > función file(). El problema es que al generar la información quiero crear | > una tabla con filas que alternen entre dos colores. Este es el script que | > tengo: | > | > $news = file ('http://aepd.mtc.ge.com/portal/test/news.inc'); | > echo '<table width:"75%" border="0" bordercolor="black" cellspacing="1" | > cellpadding="1"><tbody>'; | > foreach ($news as $line_num => $newsline) { | > echo '<tr><td style="background-color: rgb('.$tcolor.');"><p>'; | > echo $newsline; | > echo '<br></p></td></tr>'; | > if ($tcolor = '204,204,204'){ | > $tcolor = '255,255,255';} | > else { | > $tcolor= '204,204,204';} | > } | > echo '</tbody></table>'; | > | > Alguna sugerencia? | > | > Gracias | > Kaleb | > | > -- | > PHP Spanish Localization Talk Mailing List (http://www.php.net/) | > To unsubscribe, visit: http://www.php.net/unsub.php | > | | -- | PHP Spanish Localization Talk Mailing List (http://www.php.net/) | To unsubscribe, visit: http://www.php.net/unsub.php |

« previous php.general.es (#46424) next »