ASP内容分两列显示
以下ASP程序是一行一行显示数据的,想把它修改成两列对称显示的效果,请高手赐教?<%dimsql,rsBigClass,rsSmallClass,rsImagesetrs...
以下ASP程序是一行一行显示数据的,想把它修改成两列对称显示的效果,请高手赐教?
<%
dim sql,rsBigClass,rsSmallClass,rsImage
set rsBigClass=server.CreateObject("adodb.recordset")
rsBigClass.open "Select * From BigClass",conn,1,3
do while not rsBigClass.eof
%>
<table width="96%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:15px;">
<tr>
<td width="30%" align="center" valign="middle">
<%
set prod_img=server.CreateObject("adodb.recordset")
prod_img.open "select DefaultPicUrl,id from product where Elite = true and BigClassName='"&rsBigClass("BigClassName")&"' order by id asc",conn,1,3
if prod_img.recordcount>=1 then
response.Write("<img src='"&prod_img("DefaultPicUrl")&"' width=90px height=90px>")
end if
prod_img.close
set prod_img=nothing
%></td>
<td width="70%"><a href="show_product.asp?BigClassName=<%=rsBigClass("BigClassName")%>" ><b><%=rsBigClass("BigClassName")%></b></a><br />
<%
set rsSmallClass=server.CreateObject("adodb.recordset")
rsSmallClass.open "Select * From SmallClass Where BigClassName='" & rsBigClass("BigClassName") & "'",conn,1,3
if not(rsSmallClass.bof and rsSmallClass.eof) then
do while not rsSmallClass.eof
%>
<%=rsSmallClass("SmallClassName")%> |
<%
rsSmallClass.movenext
loop
end if
rsSmallClass.close
set rsSmallClass=nothing
%>
</td>
</tr>
</table>
<%
rsBigClass.movenext
loop
rsBigClass.close
set rsBigClass=nothing
call CloseConn()
%> 展开
<%
dim sql,rsBigClass,rsSmallClass,rsImage
set rsBigClass=server.CreateObject("adodb.recordset")
rsBigClass.open "Select * From BigClass",conn,1,3
do while not rsBigClass.eof
%>
<table width="96%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:15px;">
<tr>
<td width="30%" align="center" valign="middle">
<%
set prod_img=server.CreateObject("adodb.recordset")
prod_img.open "select DefaultPicUrl,id from product where Elite = true and BigClassName='"&rsBigClass("BigClassName")&"' order by id asc",conn,1,3
if prod_img.recordcount>=1 then
response.Write("<img src='"&prod_img("DefaultPicUrl")&"' width=90px height=90px>")
end if
prod_img.close
set prod_img=nothing
%></td>
<td width="70%"><a href="show_product.asp?BigClassName=<%=rsBigClass("BigClassName")%>" ><b><%=rsBigClass("BigClassName")%></b></a><br />
<%
set rsSmallClass=server.CreateObject("adodb.recordset")
rsSmallClass.open "Select * From SmallClass Where BigClassName='" & rsBigClass("BigClassName") & "'",conn,1,3
if not(rsSmallClass.bof and rsSmallClass.eof) then
do while not rsSmallClass.eof
%>
<%=rsSmallClass("SmallClassName")%> |
<%
rsSmallClass.movenext
loop
end if
rsSmallClass.close
set rsSmallClass=nothing
%>
</td>
</tr>
</table>
<%
rsBigClass.movenext
loop
rsBigClass.close
set rsBigClass=nothing
call CloseConn()
%> 展开
展开全部
<%
dim sql,rsBigClass,rsSmallClass,rsImage
set rsBigClass=server.CreateObject("adodb.recordset")
rsBigClass.open "Select * From BigClass",conn,1,3%>
<table width="96%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:15px;">
<%
dim j
J=0
do while not rsBigClass.eof%>
<%IF j mod 2 =0 THEN%>
<tr>
<%ELSE%>
<td width="50%" align="center" valign="middle">
<table width="96%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:15px;">
<tr>
<td width="30%" align="center" valign="middle">
<%
set prod_img=server.CreateObject("adodb.recordset")
prod_img.open "select DefaultPicUrl,id from product where Elite = true and BigClassName='"&rsBigClass("BigClassName")&"' order by id asc",conn,1,3
if prod_img.recordcount>=1 then
response.Write("<img src='"&prod_img("DefaultPicUrl")&"' width=90px height=90px>")
end if
prod_img.close
set prod_img=nothing
%></td>
<td width="70%"><a href="show_product.asp?BigClassName=<%=rsBigClass("BigClassName")%>" ><b><%=rsBigClass("BigClassName")%></b></a><br />
<%
set rsSmallClass=server.CreateObject("adodb.recordset")
rsSmallClass.open "Select * From SmallClass Where BigClassName='" & rsBigClass("BigClassName") & "'",conn,1,3
if not(rsSmallClass.bof and rsSmallClass.eof) then
do while not rsSmallClass.eof
%>
<%=rsSmallClass("SmallClassName")%> |
<%
rsSmallClass.movenext
loop
end if
rsSmallClass.close
set rsSmallClass=nothing
%>
</td>
</tr>
</table><TD>
<%IF j mod 2 =1 THEN %>
</tr>
<%
end if
End if
rsBigClass.movenext
J=J+1
loop%>
</table>
<%rsBigClass.close
set rsBigClass=nothing
call CloseConn()
%>
dim sql,rsBigClass,rsSmallClass,rsImage
set rsBigClass=server.CreateObject("adodb.recordset")
rsBigClass.open "Select * From BigClass",conn,1,3%>
<table width="96%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:15px;">
<%
dim j
J=0
do while not rsBigClass.eof%>
<%IF j mod 2 =0 THEN%>
<tr>
<%ELSE%>
<td width="50%" align="center" valign="middle">
<table width="96%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:15px;">
<tr>
<td width="30%" align="center" valign="middle">
<%
set prod_img=server.CreateObject("adodb.recordset")
prod_img.open "select DefaultPicUrl,id from product where Elite = true and BigClassName='"&rsBigClass("BigClassName")&"' order by id asc",conn,1,3
if prod_img.recordcount>=1 then
response.Write("<img src='"&prod_img("DefaultPicUrl")&"' width=90px height=90px>")
end if
prod_img.close
set prod_img=nothing
%></td>
<td width="70%"><a href="show_product.asp?BigClassName=<%=rsBigClass("BigClassName")%>" ><b><%=rsBigClass("BigClassName")%></b></a><br />
<%
set rsSmallClass=server.CreateObject("adodb.recordset")
rsSmallClass.open "Select * From SmallClass Where BigClassName='" & rsBigClass("BigClassName") & "'",conn,1,3
if not(rsSmallClass.bof and rsSmallClass.eof) then
do while not rsSmallClass.eof
%>
<%=rsSmallClass("SmallClassName")%> |
<%
rsSmallClass.movenext
loop
end if
rsSmallClass.close
set rsSmallClass=nothing
%>
</td>
</tr>
</table><TD>
<%IF j mod 2 =1 THEN %>
</tr>
<%
end if
End if
rsBigClass.movenext
J=J+1
loop%>
</table>
<%rsBigClass.close
set rsBigClass=nothing
call CloseConn()
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询