README.md
December 4, 2022 · View on GitHub
Description
The fastest way to do alternate colors of rows in your table (from recordset or something)
More Info
| Submitted On | |
| By | Rammi |
| Level | Intermediate |
| User Rating | 4.6 (32 globes from 7 users) |
| Compatibility | ASP (Active Server Pages), HTML |
| Category | Miscellaneous |
| World | ASP / VbScript |
| Archive File |
Source Code
<html>
<head>
<title>Alternate rows
color</title>
</head>
<style>
.lnTrue {
background :
Gray;
}
.lnFalse {
background :
Silver;
}
</style>
<body>
<table>
<tr>
<th>Test</th>
</tr>
<%
Dim
objRs, blnLine
Set objRs = Server.CreateObject("ADODB.RecordSet")
objRs.Open "SOME QUERY
HERE", "Connection string"
blnLine =
False
Do Until objRs.EOF
Response.Write "<tr class=""ln" & blnLine & """>"
& _
"<td>" & objRs(0) &
"</td></tr>"
blnLine =
Not(blnLine)
objRs.MoveNext
Loop
Set objRs
= Nothing
%>
</table>
</body>
</html>
--------------------------------------------
Blue bold parts are the most
important...