Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie - evaluating even vs. odd number

Status
Not open for further replies.

ncar35b

Technical User
Joined
Jan 10, 2003
Messages
55
Location
US
Hello. I'm creating a dynamic table from content in a database and I'd like every other row in the table to be a unique color so it's easier to read. I can't find the syntax in vbscript to do this. Logically, I would imagine it's something like

(x is a number)

if x = anOddNumber then
<tr bgcolor="grey">
elseif x = anEvenNumber then
<tr bgcolor="white">
end if

Can anyone help me with this?
 
If (x Mod 2) = 1 Then
' odd
Else
' even
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top