Forums

This topic is locked

Rotate row/column cell colors on results page

Posted 05 Oct 2001 23:35:46
1
has voted
05 Oct 2001 23:35:46 Jeff Hansen posted:
I wish to rotate the color of the cells with each new row... ie. blue,red,blue,red as the rows are added. This is of course for dynamic data comign from the db. Anyone know how to do this?

Jeff


Replies

Replied 06 Oct 2001 15:04:53
06 Oct 2001 15:04:53 Owen Eastwick replied:
This block of code should give you the general idea:

<pre id=code><font face=courier size=2 id=code>
&lt;% Counter = 1 %&gt;
&lt;% While ((Repeat1__numRows &lt;&gt; 0) AND (NOT Recordset1.EOF))%&gt;
&lt;%If Counter Mod 2 = 0 Then%&gt;
&lt;tr bgcolor="#C0C0C0" valign="top"&gt;
&lt;td width="50"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(Recordset1.Fields.Item("TextID".Value)%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;td width="150"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(Recordset1.Fields.Item("ItemTitle".Value)%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;td width="500"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%= Replace(Recordset1.Fields.Item("ItemText".Value,VbCrLf,"&lt;br&gt;"%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;% Else %&gt;
&lt;tr bgcolor="#E5E5E5" valign="top"&gt;
&lt;td width="50"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(Recordset1.Fields.Item("TextID".Value)%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;td width="150"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%=(Recordset1.Fields.Item("ItemTitle".Value)%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;td width="500"&gt;&lt;font size="-2" face="Arial, Helvetica, sans-serif"&gt;&lt;%= Replace(Recordset1.Fields.Item("ItemText".Value,VbCrLf,"&lt;br&gt;"%&gt;
&lt;/font&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;% End If %&gt;
&lt;%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Counter = Counter + 1
Wend
%&gt;
</font id=code></pre id=code>

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Edited by - oeastwick on 10/07/2001 10:15:51

Reply to this topic