Re: [PHP-ES] de nuevo impresion

From: KarlanKas ( php .en. karlankas.net)
Date: Wed Mar 10 2004 - 11:55:21 CET


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 .en. fjcorona.com.mx>
To: "Lopez, Kaleb (GEAE, Foreign National, CIAT)" < kaleb.lopez .en. ae.ge.com>;
"Php-Es (E-mail)" < php-es .en. 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 .en. ae.ge.com>
| To: "Php-Es (E-mail)" < php-es .en. 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
|

-- 
PHP Spanish Localization Talk Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


This archive was generated by hypermail 2.1.7 : Fri May 14 2004 - 16:04:35 CEST