note 109128 deleted from language.operators.arithmetic by danbrown

From: Date: Tue, 26 Jun 2012 13:58:26 +0000
Subject: note 109128 deleted from language.operators.arithmetic by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-188837@lists.php.net to get a copy of this message
Note Submitter: DEBO Jurgen ---- // Alternation of rows by use of modulo // coded by DEBO Jurgen <jurgen@person.be> // Note: Don't forget to put even and odd in DOUBLE quotes inside SINGLE quotes. $html = '<table>'; $Trow = 0; // init table row counter, reset at header back to 0 foreach ... { ... if $isTheader { // Table header section ... $html .= '<tr><th>' ... '</th></tr>'; ... $Trow=0; ... } ... $html .= '<tr class=' . ((++$Trow % 2 == 0) ? '"even"' : '"odd"') . '>'; // Alternation happens here ... ... $html .= '</tr>'; ... } $html .= '</table';

« previous php.notes (#188837) next »