asp横向排列问题
刚学编程,碰到难题了,奇怪为什么不能横向排列呢,望高手指点.<tableborder="0"cellpadding="0"cellspacing="0"><tr><%j=...
刚学编程,碰到难题了,奇怪为什么不能横向排列呢,望高手指点.
<table border="0" cellpadding="0" cellspacing="0"><tr>
<%
j=1
do while not (rs.eof or err)
if (j mod 3)=1 then
response.write "<td>"
end if
%>
<a href='product/List.asp?Shop_ID=<%=rs("Shop_ID")%>' target="_blank"><img border='0' width='148' height='118' src="product/Pic/<%=rs("pic")%>" align='center' /><br />
<b><a class="STYLE1" href="product/List.asp?Shop_id=<%=rs("shop_id")%>" target="_blank"><%=left(rs("shop_name"),12)%></a></b><br />
<%
if len(trim(rs("introduce")))>=100 then
response.write left(trim(rs("introduce")),99)&".."
else
response.write trim(rs("introduce"))
end if%>
<%
j=j+1
rs.moveNext
response.write "</td>"
if j>3 then exit do
loop
end if
%>
</tr>
</table> 展开
<table border="0" cellpadding="0" cellspacing="0"><tr>
<%
j=1
do while not (rs.eof or err)
if (j mod 3)=1 then
response.write "<td>"
end if
%>
<a href='product/List.asp?Shop_ID=<%=rs("Shop_ID")%>' target="_blank"><img border='0' width='148' height='118' src="product/Pic/<%=rs("pic")%>" align='center' /><br />
<b><a class="STYLE1" href="product/List.asp?Shop_id=<%=rs("shop_id")%>" target="_blank"><%=left(rs("shop_name"),12)%></a></b><br />
<%
if len(trim(rs("introduce")))>=100 then
response.write left(trim(rs("introduce")),99)&".."
else
response.write trim(rs("introduce"))
end if%>
<%
j=j+1
rs.moveNext
response.write "</td>"
if j>3 then exit do
loop
end if
%>
</tr>
</table> 展开
2个回答
展开全部
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<%
i=1
do while not rs.eof
%>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href='product/List.asp?Shop_ID=<%=rs("Shop_ID")%>' target="_blank"><img border='0' width='148' height='118' src="product/Pic/<%=rs("pic")%>" align='center' /></a></td>
</tr>
<tr>
<td><a class="STYLE1" href="product/List.asp?Shop_id=<%=rs("shop_id")%>" target="_blank"><%=left(rs("shop_name"),12)%></a></td>
</tr>
</table>
</td>
<%if i mod 3 =0 then response.Write "</tr><tr>"
i=i+1
rs.movenext
loop
rs.close
set rs=nothing%>
<tr>
<%
i=1
do while not rs.eof
%>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href='product/List.asp?Shop_ID=<%=rs("Shop_ID")%>' target="_blank"><img border='0' width='148' height='118' src="product/Pic/<%=rs("pic")%>" align='center' /></a></td>
</tr>
<tr>
<td><a class="STYLE1" href="product/List.asp?Shop_id=<%=rs("shop_id")%>" target="_blank"><%=left(rs("shop_name"),12)%></a></td>
</tr>
</table>
</td>
<%if i mod 3 =0 then response.Write "</tr><tr>"
i=i+1
rs.movenext
loop
rs.close
set rs=nothing%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询