很多时候,我们采用原始的方法来解决一行内循环3张图片,如果上传者只上传了2张图片,那么2张图片间的距离会很大,因为缺少了一个<td> </td>.
<table border="0" cellpadding="0" cellspacing="0">
<%
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.RecordCount/colzs)
else
rowzs=int(rs.RecordCount/colzs)+1
end if
for j = 1 to rowzs%>
<tr>
<%for i = 1 to colzs%>
<%if not rs.EOF then%>
<td><input type="checkbox" name="qxflag<%=m%>" value="1"><%=trim(rs("bigname"))%></td>
<%
rs.MoveNext
m = m + 1
else
%>
<td> </td>
<%end if%>
<%next%>
</tr>
<%
next
rs.Close
set rs = nothing
%>
</table>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛