asptoday_discuss thread: format row in table
Message #1 by "Mai-Britt Jensen" <maconi@s...> on Wed, 1 May 2002 10:33:41
|
|
I have made a table with response write
for i = 1 to RShardware.PageSize
if RShardware.EOF then exit for
Response.Write"<TR>"
Response.Write "<td align=left
width=300px>"
Response.Write RShardware("Hardware")
I would like to have every second row with another bgcolor. Is this
possible?
Message #2 by "Dave Cranwell" <david@t...> on Wed, 1 May 2002 11:16:25 +0100
|
|
Just initialise a variable above the loop that contains the start colour.
Then on every itteration of the loop say:
if(colour_variable=='start_colour') {
colour_variable=new_colour
}else{
colour_variable=start_colour
}
Then use that colour_variable to output the colour of the <Td /> ever time
round the loop
--------------------------
Dave Cranwell
Torchbox Ltd
david@t...
tel: (+44) 1608 811 870
mob: (+44) 7760 438 708
http://www.torchbox.com
----- Original Message -----
From: "Mai-Britt Jensen" <maconi@s...>
To: "ASPToday Discuss" <asptoday_discuss@p...>
Sent: Wednesday, May 01, 2002 10:33 AM
Subject: [asptoday_discuss] format row in table
> I have made a table with response write
> for i = 1 to RShardware.PageSize
> if RShardware.EOF then exit for
>
> Response.Write"<TR>"
> Response.Write "<td align=left
> width=300px>"
> Response.Write RShardware("Hardware")
>
> I would like to have every second row with another bgcolor. Is this
> possible?
>
Message #3 by "Joe Hughes" <JoeHughes@M...> on Wed, 1 May 2002 22:40:26 +0100
|
|
Hi Mai-Britt,
Something like;
'----------------------------
dim i
dim rsHardWare
dim bgcolor
For i = 1 to rsHardWare.PageSize
If rsHardWare.eof then exit for
If i Mod 2 = 1 Then BGColor = "#EEEEEE" Else BGColor = "#FFFFFF"
%>
<TR BGColor=<%=bgcolor%>>#
<TD align=Left><%=rsHardWare("hardware")%></TD>
</TR>
<%
Next
'----------------------------
HTH
Joe Hughes
-----Original Message-----
From: Mai-Britt Jensen [mailto:maconi@s...]
Sent: 01 May 2002 10:34
To: ASPToday Discuss
Subject: [asptoday_discuss] format row in table
I have made a table with response write
for i = 1 to RShardware.PageSize
if RShardware.EOF then exit for
Response.Write"<TR>"
Response.Write "<td align=left
width=300px>"
Response.Write RShardware("Hardware")
I would like to have every second row with another bgcolor. Is this
possible?
|