Cree tableau 1 couleur sur 2

cs_mael974 Messages postés 108 Date d'inscription jeudi 2 juin 2005 Statut Membre Dernière intervention 10 mars 2011 - 21 juin 2005 à 10:21
jesusonline Messages postés 6814 Date d'inscription dimanche 15 décembre 2002 Statut Membre Dernière intervention 13 octobre 2010 - 21 juin 2005 à 12:33
bonjour woila je cherche a afficher mes resultats sous forme de tableau ...et je souhaite que la couleur des lignes change une ligne sur 2 ( bleu et blanche) , jai integrer ce code ms laffiche est tres bizzar et la couleurs des lignes ne change qune fois sur 3 :


<% if ok<>"on" Then


SQL="SELECT Désign, Série, Service,Agent,Fourn from SIPANNE_BINDERS where Fourn= ' "& Fourn&"' "


RS1.Open SQL,session ("dbconn")%>


<table width = "100%">


<tr>


<th width="2%" bgcolor=#3399FF> </th>


<th width="20%" bgcolor=#3399FF> Désignation </th>


<th width="20%" bgcolor=#3399FF> Série </th>


<th width = "18%" bgcolor=#3399FF> Fournisseur </th>


<th width = "20%" bgcolor=#3399FF> Agent </th>


<% if not RS1.EOF then


x=0


RS1.MoveFirst


do while not RS1.eof %>


<% for i = 1 to 2 %>


<tr>


<% for j = 1 to x


if ((j+i) mod 2) = 0 then %>


<td valign="middle" align="center" bgcolor=#CCFFFF>[Fiche_mat.asp?mat=<%=Rs1( " ] </td>


<td bgcolor=#CCFFFF> <%=RS1("Désign")%> </td>


<td valign="middle" align="center" bgcolor="#CCFFFF"> <%=RS1("Série")%> </td>


<td valign="middle" align="center" bgcolor="#CCFFFF"> <%=RS1("Fourn")%> </td>


<td valign="middle" align="center" bgcolor="#CCFFFF"> <%=RS1("Agent")%> </td>


<%else %>


<td valign="middle" align="center" bgcolor="white">[Fiche_mat.asp?mat=<%=Rs1( " ] </td>


<td bgcolor="white"> <%=RS1("Désign")%> </td>


<td valign="middle" align="center" bgcolor="white"><%=RS1("Série")%> </td>


<td valign="middle" align="center" bgcolor="white"> <%=RS1("Fourn")%> </td>


<td valign="middle" align="center" bgcolor="white"> <%=RS1("Agent")%>


</td>


</tr>


<% end if %>


<% next %>


<% next %>


<%


x=x+1


RS1.MoveNext


Loop


End if


response.write " total= " & i


end if


'=== libération des ressources


Set RS1=nothing


%>




</HTML>

> MaEl <

1 réponse

jesusonline Messages postés 6814 Date d'inscription dimanche 15 décembre 2002 Statut Membre Dernière intervention 13 octobre 2010 29
21 juin 2005 à 12:33
en .net il suffit de mettre l'alterningitemTemplate ou il faut et c'est bon ;)



bref, je connais pas asp mais je pense quand meme pouvoir taider :)





<% dim i = 0

dim alt = false

do while truc



if i % 2 = 0 then

alt = false

end if

%>



puis dans ton code

tu regardes alt s'il est à true alors ta ligne change de couleur





<%loop%>

<hr>Cyril - MCP ASP.net
Webmaster de : Hoshimi.CodeS-SourceS.fr
0
Rejoignez-nous