[support] trying to create zebra striping in custom block

Rohan Smith rohanasmith at gmail.com
Wed Jun 16 14:03:10 UTC 2010


try this

function isEven($x){if($x%2==0){return true;}else{return false;}}
$oddeven=1;

print "<tr class=\"";
if(isEven($oddeven){print "even";}else{print "odd";})$oddeven++
print "\"><td>";





R.A.Smith
Manager/Technical Lead
Exterbox - "Thinking outside of the box"
http://www.exterbox.com
rohan at exterbox.com
1-876-449-7506



On Sat, Jun 12, 2010 at 10:06 AM, Neil Coghlan <neil at esl-lounge.com> wrote:

>  I have a custom block showing the users whose content has attracted most
> pageviews.
>
> part of my code is this:
>
> print "<tr class=\"";
> print $zebra;
> print "\"><td>";
>
> this is a drupal 6 installation and I don't seem to be able to get the
> odd/even classes I'm looking for. If I put print "odd", they all come out
> grey, "even" and they all come out white, so I know the syntax of the code
> is fine...I just can't get the zebra variable working.
>
> any tips what I'm failing to do??
>
> Neil
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100616/cd52b3b2/attachment.html 


More information about the support mailing list