ASP中图片读取,如何换行呢?
<%k=0sql="selecttop10*fromnewswhereppid=4andcnflag=1andtjflag=1orderbyeditdatedesc"rs...
<% k=0
sql="select top 10 * from news where ppid=4 and cnflag=1 and tjflag=1 order by editdate desc"
rs.Open sql,cn,1,1
do while not rs.EOF
url=trim(rs("url"))
if url="" then url="news_details.asp?keyno="&keyno&"&id="&rs("id")
%>
<table width="140" border="0" align="left" cellpadding="0" cellspacing="0" style="display:inline">
<tr>
<td><table width="100" border="0" align="center" cellpadding="4" cellspacing="0" class="bodyline">
<tr>
<td><a href="<%=url%>"><img src="../upload/<%=rs("picfilename")%>" width="101" height="94" border="0"></a><a href="<%=url%>"></a></td>
</tr>
</table>
<table width="132" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="<%=url%>" class="grey_B_link"><%=left(rs("title"),18)%></a></td>
</tr>
</table></td>
</tr>
</table>
<%
rs.MoveNext
loop
rs.Close
%>
我想显示4个图片新闻,然后换行,如何改呢? 展开
sql="select top 10 * from news where ppid=4 and cnflag=1 and tjflag=1 order by editdate desc"
rs.Open sql,cn,1,1
do while not rs.EOF
url=trim(rs("url"))
if url="" then url="news_details.asp?keyno="&keyno&"&id="&rs("id")
%>
<table width="140" border="0" align="left" cellpadding="0" cellspacing="0" style="display:inline">
<tr>
<td><table width="100" border="0" align="center" cellpadding="4" cellspacing="0" class="bodyline">
<tr>
<td><a href="<%=url%>"><img src="../upload/<%=rs("picfilename")%>" width="101" height="94" border="0"></a><a href="<%=url%>"></a></td>
</tr>
</table>
<table width="132" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="<%=url%>" class="grey_B_link"><%=left(rs("title"),18)%></a></td>
</tr>
</table></td>
</tr>
</table>
<%
rs.MoveNext
loop
rs.Close
%>
我想显示4个图片新闻,然后换行,如何改呢? 展开
展开全部
<% k=0
sql="select top 10 * from news where ppid=4 and cnflag=1 and tjflag=1 order by editdate desc"
rs.Open sql,cn,1,1
%>
<table width="140" border="0" align="left" cellpadding="0" cellspacing="0" style="display:inline">
<tr>
<%
i=0
do while not rs.EOF
url=trim(rs("url"))
if url="" then url="news_details.asp?keyno="&keyno&"&id="&rs("id")
%>
<td>
<table width="100" border="0" align="center" cellpadding="4" cellspacing="0"
class="bodyline">
<tr>
<td><a href="<%=url%>"><img src="../upload/<%=rs("picfilename")%>" width="101" height="94"
border="0"></a><a href="<%=url%>"></a></td>
</tr>
</table>
<table width="132" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="<%=url%>" class="grey_B_link"><%=left(rs("title"),18)%></a></td>
</tr>
</table></td>
<%
i=i+1
if i mod 4=0 then
response.write"</tr>"
end if
rs.MoveNext
loop
rs.Close
%>
</tr>
</table>
sql="select top 10 * from news where ppid=4 and cnflag=1 and tjflag=1 order by editdate desc"
rs.Open sql,cn,1,1
%>
<table width="140" border="0" align="left" cellpadding="0" cellspacing="0" style="display:inline">
<tr>
<%
i=0
do while not rs.EOF
url=trim(rs("url"))
if url="" then url="news_details.asp?keyno="&keyno&"&id="&rs("id")
%>
<td>
<table width="100" border="0" align="center" cellpadding="4" cellspacing="0"
class="bodyline">
<tr>
<td><a href="<%=url%>"><img src="../upload/<%=rs("picfilename")%>" width="101" height="94"
border="0"></a><a href="<%=url%>"></a></td>
</tr>
</table>
<table width="132" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><a href="<%=url%>" class="grey_B_link"><%=left(rs("title"),18)%></a></td>
</tr>
</table></td>
<%
i=i+1
if i mod 4=0 then
response.write"</tr>"
end if
rs.MoveNext
loop
rs.Close
%>
</tr>
</table>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询