ciao!
come posso dividere il risultato di una ricerca in DB su più righe, considerando che ogni riga deve avere 10 celle (e quindi rappresenta 10 record del db)?
ciao!
come posso dividere il risultato di una ricerca in DB su più righe, considerando che ogni riga deve avere 10 celle (e quindi rappresenta 10 record del db)?
........\ | /......
......(@ @)).....
-oOO-(_)-OOo-
......Angie.....
ho fatto così
codice:foto = 0 if not rs.eof then do until rs.eof foto = foto + 1 if foto <= 10 then response.write("<td>"&rs("nomepag")&"</td>") if foto = 10 then response.write("</tr>") end if else foto = 10 response.write("<tr>") response.write("<td>"&rs("nomepag")&"</td>") end if rs.movenext loop end if
........\ | /......
......(@ @)).....
-oOO-(_)-OOo-
......Angie.....
codice:foto = 0 response.write("<tr>") if not rs.eof then do until rs.eof foto = foto + 1 if foto > 10 Then foto = 1 response.write("</tr><tr>") end if response.write("<td>" & rs("nomepag") & "</td>") rs.movenext loop end if response.write("</tr>")
uhm.. però può capitare che nell'ultima riga non ci siano 10 record .. ma qualcuno in meno .. come posso sistemare il colspan?
........\ | /......
......(@ @)).....
-oOO-(_)-OOo-
......Angie.....
codice:foto = 0 response.write("<tr>") if not rs.eof then do until rs.eof foto = foto + 1 if foto > 10 Then foto = 1 response.write("</tr><tr>") end if response.write("<td>" & rs("nomepag") & "</td>") rs.movenext loop end if do until foto > 10 response.write("<td></td>") foto = foto + 1 loop response.write("</tr>")
Oppure così
codice:foto = 0 response.write("<tr>") if not rs.eof then do until rs.eof foto = foto + 1 if foto > 10 Then foto = 1 response.write("</tr><tr>") end if response.write("<td>" & rs("nomepag") & "</td>") rs.movenext loop end if if foto >1 and foto < 10 response.write("<td colspan=""" & 10-foto & """></td>") end if response.write("</tr>")
ho provato questo codice .. grazie mille!Originariamente inviato da longline
codice:foto = 0 response.write("<tr>") if not rs.eof then do until rs.eof foto = foto + 1 if foto > 10 Then foto = 1 response.write("</tr><tr>") end if response.write("<td>" & rs("nomepag") & "</td>") rs.movenext loop end if do until foto > 10 response.write("<td></td>") foto = foto + 1 loop response.write("</tr>")![]()
........\ | /......
......(@ @)).....
-oOO-(_)-OOo-
......Angie.....