chiark / gitweb /
Stripey tables
[ypp-sc-tools.db-test.git] / yarrg / web / query_age
index a90ca3469811b249d5d9c3cde0364d63a136662b..fc7999341fee3451976280d98faa00d2770aa1b1 100644 (file)
@@ -69,6 +69,7 @@ $sth->execute();
 % my %da_ages;
 % my %ts_sortkeys;
 % $da_ages{'id_loaded'}= 0;
+% my $rowix= 0;
 % while ($row=$sth->fetchrow_hashref) {
 %      my $rowid= "id_$row->{'islandid'}";
 %      my $cellid= "c$rowid";
@@ -76,14 +77,15 @@ $sth->execute();
 %      $ts_sortkeys{'0'}{$rowid}= $row->{'archipelago'};
 %      $ts_sortkeys{'1'}{$rowid}= $row->{'islandname'};
 %      $da_ages{$rowid}= $age;
-<tr id=<% $rowid %>
+<tr id=<% $rowid %> class="<% 'datarow'.($rowix & 1) %>"
    > <td><% $row->{'archipelago'} |h
   %> <td><% $row->{'islandname'} |h
   %> <td id="<% $cellid %>"><% prettyprint_age($age) %> </tr>
+%      $rowix++;
 % }
 </table>
 
-<& tabsort, table => 'ts_table', cols => [
+<& tabsort, table => 'ts_table', rowclass => 'datarow', cols => [
        {}, {},
        { DoReverse => 1,
          Numeric => 1,