webForumDet fria alternativet

Problem med MOD

4 svar · 195 visningar · startad av SteveP

StevePMedlem sedan mars 2003751 inlägg
#1

Jag skriver ut 4 bilder efter varandra sen slänger den in en <TR> för ny rad, detta fungerar utmärkt.

Mellan varje bild lägger jag in en "bild" för att separera dom lite snyggare.
Problemet är nu att den lägger in separeringsbilden efter sista bilden visats.

Såhär ser det ut nu

BILD1 | BILD2 | BILD3 | BILD4 |

Jag vill att det ska se ut såhär

BILD1 | BILD2 | BILD3 | BILD4

Alltså ska inte separeringsbilden visas efter BILD4

Ni förstår nog bättre när jag visar koden.

		<table width="502" border="0"  cellspacing="0" cellpadding="0" align="center">
		<tr>
		<% 
			intCounter = 0
			do until RsPictures.EOF 
			intCounter = intCounter + 1
		%>
		
		<td width="120" align="center" height="18"><a class="lyric" href="javascript:popup('PictureView.asp?ID=<%=RsPictures("PicID")%>','PictureView',300,350)"><img src="Images/Upload/<%=RsPictures("Blob")%>" border="0" width="117"></a></td>
		<td width="6" align="center" height="18" background="images/main/dotted_vertikalt.gif"></td>
		<% 
			if intCounter MOD 4 = 0 Then Response.Write "</tr><tr>"
			RsPictures.MoveNext
			loop 
		%> 
		</tr>	
		</table>
crisse6Medlem sedan dec. 20002 441 inlägg
#2
strBla = RSPictures("blob")
strPic = "<img src="""&Left(strBla, Len(strBla) - 2)&""">"

eh.... ar trott.... vet inte om jag tankte ratt nu... ;)

SebbeMedlem sedan jan. 20031 603 inlägg
#3

Kanske så här?

<table width="502" border="0"  cellspacing="0" cellpadding="0" align="center">
<tr>
<% 
intCounter = 0
Do Until RsPictures.EOF 
  intCounter = intCounter + 1
%>
<td width="120" align="center" height="18"><a class="lyric" href="java script:popup('PictureView.asp?ID=<%=RsPictures("PicID")%>','PictureView',300,350)"><img src="Images/Upload/<%=RsPictures("Blob")%>" border="0" width="117"></a></td>
<%
  If intCounter Mod 4 > 0 Then Response.Write("<td width=""6"" align=""center"" height=""18"" background=""images/main/dotted_vertikalt.gif""></td>")
  If intCounter Mod 4 = 0 Then Response.Write("</tr><tr>")
  RsPictures.MoveNext
Loop 
%> 
</tr>	
</table>
crisse6Medlem sedan dec. 20002 441 inlägg
#4

Hanger inte med vad din kod gor for nytta dar Sebbe?

PoffeMedlem sedan apr. 20022 935 inlägg
#5
		<table width="502" border="0"  cellspacing="0" cellpadding="0" align="center">
		<tr>
		<% 
			intCounter = 0
			do until RsPictures.EOF 
			intCounter = intCounter + 1
		%>
		<td width="120" align="center" height="18"><a class="lyric" href="java script:popup('PictureView.asp?ID=<%=RsPictures("PicID")%>','PictureView',300,350)"><img src="Images/Upload/<%=RsPictures("Blob")%>" border="0" width="117"></a></td>
		<% 
			if intCounter MOD 4 = 0 Then 
				Response.Write "</tr><tr>"
			else
				Response.Write("<td width=""6"" align=""center"" height=""18"" background=""images/main/dotted_vertikalt.gif""></td>")
			end if
			RsPictures.MoveNext
			loop 
		%> 
		</tr>	
		</table>
Genererad på 368 ms · cache AV · v20260730165559-full.f96bc7eb