Skiftende farver på linier
Jeg har et clanwar script og jeg skal have det lavet sådan at hveranden tabel linie er en anden farve´Kode:
<table border="0" cellspacing="0" cellpadding="1" width="100%" ID="Table14">
<tr>
<td width=25%><font face=tahoma size=2 color=#ffffff>Opponent</font></td>
<td width=15%><font face=tahoma size=2 color=#ffffff>Type</font></td>
<td width=15%><font face=tahoma size=2 color=#ffffff>Result</font></td>
<td width=30%><font face=tahoma size=2 color=#ffffff>Maps</font></td>
<td width=15%><font face=tahoma size=2 color=#ffffff>Date</font></td>
</tr>
<tr>
<td background=gfx/line.jpg height=1 width=100% colspan=6></td>
</tr>
<%
Set DataConn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)};uid=admin; "
DSN = dsn & "DBQ=" & server.mappath("db/db.mdb")
DataConn.Open DSN
%>
<%
Set show = Server.CreateObject("ADODB.RecordSet")
show.open "Select * From [kampe] order by id desc", DataConn
if not show.EOF then
show.MoveFirst
end if
do while not show.EOF
if int(show("resultat_os")) > int(show("resultat_dem")) then color = "#33CC33"
if int(show("resultat_os")) < int(show("resultat_dem")) then color = "#CC3333"
if int(show("resultat_os")) = int(show("resultat_dem")) then color = "#CCCC33"
%>
<tr>
<td><font face=tahoma size=2 color=#ffffff><a href="default.asp?page=cw_report&id=<%=show("id")%>"><%=show("fjende")%></a></font></td>
<td><font face=tahoma size=2 color=#ffffff><%=show("type")%></font></td>
<td><font face=tahoma size=2 color=<%=color%>><%=show("resultat_os")%> - <%=show("resultat_dem")%></font></td>
<td><font face=tahoma size=2 color=#ffffff><%=show("map1")%> / <%=show("map2")%></font></td>
<td><font face=tahoma size=2 color=#ffffff><%=show("dato")%></font></td>
<td align="center"><a href="default.asp?page=cw_report&id=<%=show("id")%>"><img alt="Matchreport" src="gfx/matchreport.gif" border="0" width="16" height="16"></a></td>
<td></td>
</tr>
<%
show.MoveNext
loop
show.Close
set show = nothing
Dataconn.Close
%>
</table>
