View Single Post
Old 11-17-2008, 06:54 AM   #1 (permalink)
Peuplarchie
The Acquainted
 
Peuplarchie's Avatar
 
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
Peuplarchie is on a distinguished road
Application Alternate row color ?

Good day to you all,
Here I come again with a piece of code which reach a txt file and return the text, it also convert the "\n" into "<br>".

Here it is :

PHP Code:
function drawList($list)
{     
      
$thelist '';         
      foreach(
$list as $file=>$string)
      {

        
$lines nl2br($string);
              
$thelist .= '<b class="b1h"></b><b class="b2h"></b><b class="b3h"></b><b class="b4h"></b>';
              
$thelist .= '<div class="headh">';
              
$thelist .= '<b>'.$file.'</b>';
              
$thelist .= '</div>';              
              
$thelist .= '<div class="contenth"><div class="text">';
              
$thelist .= $lines.'<br/>';
              
$thelist .= '</div>';
              
$thelist .= '</div>';
              
$thelist .= '<b class="b4bh"></b><b class="b3bh"></b><b class="b2bh"></b><b class="b1h"></b><br/>';
    }
    return 
$thelist;
        


How can I make $lines have alternate row color ?

Thanks !
__________________
That's why we are not alone on earth... let's build !
Peuplarchie is offline  
Reply With Quote