To see the highlighting in action, try mousing over the rows of the table.
Leave it to our readers to come up with another great idea. Instead of me rehashing the idea...
here's the email message that I received:
This is a quick and nasty, but I use something like this for displaying
rows of database output, so that they can be in alternate backgrounds
similar to say old computer paper. I also have a pink highlighter line
as you scroll down the database with your mouse. I use this function in
the include part of the the ASP page so that I can use it anywhere on
the site. You may need to tidy this script up a little as I said its
cheap and nasty.
Instead of using <tr> I just use <%=Newline%>
Always remember to use Dim Seed at the top of of the ASP Page.
The new line script can be made more elegant by using CSS with border
etc etc.
Works for me, others might find it useful.
Function NewLine
if seed = 1 then
newline = "<tr bgcolor ='lavender' " _
& "onMouseover="&chr(34)&"this.bgColor= 'pink' "&chr(34)&" " _
& "onMouseout="&chr(34)&"this.bgColor='lavender'"&chr(34)&" >"
seed = 0
else
newline = "<tr bgcolor ='white' " _
& "onMouseover="&chr(34)&"this.bgColor= 'pink' "&chr(34)&" " _
& "onMouseout="&chr(34)&"this.bgColor='white'"&chr(34)&" >"
seed = 1
end if
End Function
Lawrence Edelstein
The idea of making it a function for reuse is good, but for the sample, I simply
implemented the concept inline with the code in order to keep things simple.
I also switched the highlight color to yellow since it matches our color scheme
better, but when you look at the code you'll get the idea.