cs_Dellys
Messages postés95Date d'inscriptionmercredi 26 octobre 2005StatutMembreDernière intervention24 mars 2008
-
22 déc. 2005 à 12:02
cs_Dellys
Messages postés95Date d'inscriptionmercredi 26 octobre 2005StatutMembreDernière intervention24 mars 2008
-
29 déc. 2005 à 10:57
Bonjour
Voila j'ai une boucle qui affiche des enregistrement sur un tableau ,ce que je veut c'est que méme si il ya moins de 10 enregistremts le tableau s'affiche avec 10 lignes
la boucle
Arto_8000
Messages postés1044Date d'inscriptionlundi 7 mars 2005StatutMembreDernière intervention13 juillet 20107 23 déc. 2005 à 04:51
Dim i as integer
i = 1
While (not objRS.eof && i < 11)
response.write "<tr><td bgcolor =#E2ECF5 height=41 style=border-top-width:1; border-right-width:1; border-bottom-width:1; border-left-width:1; border-color:black; border-style:solid;>" & objRS("etablis_payeur")& "</td>"
objRS.Movenext
i = i + 1
Loop
If not i = 10 Then
Dim x as Integer
For x = i to 10
response.write("<tr><td></td></tr>")
Next x
End if
Premièrement on effectue ta boucle habituel, mais on compte le nombre d'enregistrement et deuxième on affiche les lignes manquantes selon le nombre d'enregistrement compté.
J'ai pas testé parce que j'ai pas ASP.net, mais l'algorythme devrait être bon et fait attention on ne mélange pas des balises en majuscules et en minuscule en même temps.
objrs.movenext
Ncur = Ncur + 1
s=s+1
wend
If not s = 10 Then
Dim x
For x = s to 10
response.write("<tr><td> </td><td> </td><td> </td><td> </td></tr>")
Next
[?num=<%=Ndeb-Nmax%> Retour]
</td>
<%end if%>
<td height="22">
<% ' N° des pages
Npag = int(objRS.recordCount/Nmax)
if Npag < objRS.recordCount/Nmax then Npag = Npag + 1
dim i
for i = 1 to Npag
' Page courante ?
if Ndeb = (i-1)*Nmax then%>
Page <%=i%>
<%else%>
[?num=<%=(i-1)*Nmax%> <%=i%> ]
<%end if
next%>
</td>
<% ' Des fiches après ?
if not objRS.eof then%>
<td valign=top height="22">