asp循环问题!急

qq8568690 2010-04-14 11:53:41

<div id="right"><table width="739" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="35" background="images/1_20.jpg"> </td>
</tr>
<tr><td height="10"></td>
</tr>
<tr>
<td><table width="739" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="148"><div align="center"><img src="images/1.JPG" width="120" height="100" /></div></td>
<td width="146"><div align="center"><img src="images/2.jpg" width="120" height="100" /></div></td>
<td width="152"><div align="center"><img src="images/3.jpg" width="120" height="100" /></div></td>
<td width="149"><div align="center"><img src="images/4.jpg" width="120" height="100" /></div></td>
<td width="144"><div align="center"><img src="images/5.jpg" width="120" height="100" /></div></td>
</tr>
<tr>
<td height="25"><div align="center" class="STYLE3">粘性手卷纸色卡</div></td>
<td><div align="center" class="STYLE3">转印纸</div></td>
<td><div align="center" class="STYLE3">彩色夜光粉</div></td>
<td><div align="center" class="STYLE3">彩色荧光粉</div></td>
<td><div align="center" class="STYLE3">长效夜光粉</div></td>
</tr>
<tr>
<td><div align="center"><img src="images/6.jpg" width="120" height="100" /></div></td>
<td><div align="center"><img src="images/7.jpg" width="120" height="100" /></div></td>
<td><div align="center"><img src="images/8.jpg" width="120" height="100" /></div></td>
<td><div align="center"><img src="images/9.jpg" width="120" height="100" /></div></td>
<td><div align="center"><img src="images/10.jpg" width="120" height="100" /></div></td>
</tr>
<tr>
<td><div align="center" class="STYLE3">金葱粉</div></td>
<td height="25"><div align="center" class="STYLE3">金葱亮片</div></td>
<td><div align="center" class="STYLE3">免烘静电植毛浆+助剂</div></td>
<td><div align="center" class="STYLE3">有孔圆形珠、管形珠</div></td>
<td><div align="center" class="STYLE3">抗氧化特闪金葱浆、金粉浆</div></td>
</tr>
</table></td>
</tr>
</table>
</div>


我的想法是循环图片5个以后, 换tr循环5个标题以后 在换tr循环5次td的照片 再换tr循环5次td的标题
这个问题折磨一上午了,边吃饭边在线等好心的高手解决!!
...全文
225 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
kaifadi 2010-04-15
  • 打赏
  • 举报
回复
不太明白楼主的意思,不过根据4楼的意思,可以这样写:
<%
dim arr,arr2,arr3,n
n=2 '默认只执行4次!
arr=Array(空数组)
arr2=Array(图片数组)
arr3=Array(文字标题数组)
flag= true
for n=1 to n'外围循环,控制要实现几个5次的这种循环!%>
<tr>
<%for i=1 to 5%>
<td> <div align="center" class="STYLE3"><%=arr(i)%> </div> </td>
<%next%>
</tr>
<%if flag=true then'加标记判断执行哪个数组,效果是arr2和arr3交替出现!
arr=arr2
flag=false
else
arr=arr3
flag=true
end if
next
%>
按照四楼的表达意思,这样做就可以了!
eleven_123 2010-04-14
  • 打赏
  • 举报
回复
对table进行循环比较好吧
<table width="739" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="148"><div align="center"><img src="images/1.JPG" width="120" height="100" /></div></td>
</tr>
<tr>
<td height="25"><div align="center" class="STYLE3">粘性手卷纸色卡</div></td>
</tr>
</table>
never exists 2010-04-14
  • 打赏
  • 举报
回复
应该在td中把图片和标题放在一个table中。。。
qq8568690 2010-04-14
  • 打赏
  • 举报
回复
同意LS的,不过本人本折腾晕了 实在写不出来了。
4楼的劳烦写一下? 谢谢!
浙外 2010-04-14
  • 打赏
  • 举报
回复
不是太明白你的想法,你想图片、标题轮番循环,那就用个标记咯。5次一到标记换个值,再五次还原
yan11cn 2010-04-14
  • 打赏
  • 举报
回复
那就把 粘性手卷纸色卡,转印纸,彩色夜光粉,彩色荧光粉,长效夜光粉之类的都存进数组吧。循环就好
问题:1,无法循环绑定投票的标题和选项 解决方法: 在Repeater绑定中添加ItemDataBound事件,选项用RadioButtonList绑定,附源代码: Default页,源页面 代码如下:
广大网友对保障房建设相关问题调查
<asp ID=”Repeater1″ runat=”server” xss=removed> <tr> <td colspan=”3″> <%# Eval(“t_timu”)%> <asp:Litera
<% dim rs,sqltext set rs = Server.CreateObject(“adodb.recordset”) sqltext=”select * from [bigclass]” rs.Open sqltext,conn,1,1 m=1 colzs=5 ‘一行显示5列 if rs.RecordCount mod colzs=0 then rowzs=int(rs.Record

 <tr>
 

 tr>
 <tr>
 

 

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧

Menu Item1Menu Item2