ECMS V3

This page is brought to you by ECMS V3 - Next Generation Web Management (http://www.evaria.com/). When printing this page (http://www.evaria.com/v3/index/article/33/table-row-colour-separator.html),
you must include the entire legal notice at bottom.

10
district-librarian

Table row colour separator

This nifty little loop adds different colours to every second row which makes large listings easier on the eye.

4 Published 09.08.2006 - Last edited 15.08.2006 - 13913 views - 0 comments

<?php
  $i=1;
  while($row = mysql_fetch_array($result))
  {
    $color = ($i % 2) ? "#000000" : "#CCCCCC";
    echo ´<tr><td style="background-color:$color;">Here
goes query values...</td></tr>´;
    $i++;
  }
?>

Name:

Email: hidden

Website:

Comment:

Please enter these letters here (Case sensitive) *

While we are updating content in the new site, the original Evaria site can be accessed via this link.

Page generated in 0.047s

evaria.com © 1999-2012 HTML CSS Contact us Back to top