asp如何实现让表格中的一列在满3个单元格后自动换行?
<%setrs=server.CreateObject("adodb.recordset")sql="select*fromnewswherecataid="&reque...
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from news where cataid="&request("lm")&" order by addtime desc"
'response.Write sql
rs.open sql,conn,1,1
If rs.Bof Or rs.Eof Then
Response.Write("暂无数据!")
Else
do while not rs.eof
%>
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="page.asp?id=<%=rs("id")%>"><img src="<%=rs("firstImageName")%>" width="200" height="285" border="0" /></a></td>
</tr>
<tr><td height="25" align="center"><%=rs("title")%></td></tr></table>
</td>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
这是内段代码,怎么弄啊? 展开
set rs=server.CreateObject("adodb.recordset")
sql="select * from news where cataid="&request("lm")&" order by addtime desc"
'response.Write sql
rs.open sql,conn,1,1
If rs.Bof Or rs.Eof Then
Response.Write("暂无数据!")
Else
do while not rs.eof
%>
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="page.asp?id=<%=rs("id")%>"><img src="<%=rs("firstImageName")%>" width="200" height="285" border="0" /></a></td>
</tr>
<tr><td height="25" align="center"><%=rs("title")%></td></tr></table>
</td>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
这是内段代码,怎么弄啊? 展开
3个回答
展开全部
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from news where cataid="&request("lm")&" order by addtime desc"
'response.Write sql
rs.open sql,conn,1,1
If rs.Bof Or rs.Eof Then
Response.Write("暂无数据!")
Else
i=1
do while not rs.eof
%>
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="page.asp?id=<%=rs("id")%>"><img src="<%=rs("firstImageName")%>" width="200" height="285" border="0" /></a></td>
</tr>
<tr><td height="25" align="center"><%=rs("title")%></td></tr></table>
</td>
<%
if i mod 3 = 0 then
response.write("</tr><tr>")
end if
i=i+1
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
set rs=server.CreateObject("adodb.recordset")
sql="select * from news where cataid="&request("lm")&" order by addtime desc"
'response.Write sql
rs.open sql,conn,1,1
If rs.Bof Or rs.Eof Then
Response.Write("暂无数据!")
Else
i=1
do while not rs.eof
%>
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="page.asp?id=<%=rs("id")%>"><img src="<%=rs("firstImageName")%>" width="200" height="285" border="0" /></a></td>
</tr>
<tr><td height="25" align="center"><%=rs("title")%></td></tr></table>
</td>
<%
if i mod 3 = 0 then
response.write("</tr><tr>")
end if
i=i+1
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
展开全部
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from news where cataid="&request("lm")&" order by addtime desc"
rs.open sql,conn,1,1
If rs.Bof Or rs.Eof Then
Response.Write("暂无数据!")
Else
%>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<%for i=1 to rs.recordcount%>
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="page.asp?id=<%=rs("id")%>"><img src="<%=rs("firstImageName")%>" width="200" height="285" border="0" /></a></td>
</tr>
<tr><td height="25" align="center"><%=rs("title")%></td></tr></table>
</td>
<%
if int(i) mod 3=0 then
%>
</tr><tr>
<%
rs.movenext
next
%>
</tr></table>
<%
end if
rs.close
set rs=nothing
%>
试试看看
set rs=server.CreateObject("adodb.recordset")
sql="select * from news where cataid="&request("lm")&" order by addtime desc"
rs.open sql,conn,1,1
If rs.Bof Or rs.Eof Then
Response.Write("暂无数据!")
Else
%>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<%for i=1 to rs.recordcount%>
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="page.asp?id=<%=rs("id")%>"><img src="<%=rs("firstImageName")%>" width="200" height="285" border="0" /></a></td>
</tr>
<tr><td height="25" align="center"><%=rs("title")%></td></tr></table>
</td>
<%
if int(i) mod 3=0 then
%>
</tr><tr>
<%
rs.movenext
next
%>
</tr></table>
<%
end if
rs.close
set rs=nothing
%>
试试看看
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<td>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="page.asp?id=<%=rs("id")%>"><img src="<%=rs("firstImageName")%>" width="200" height="285" border="0" /></a></td>
</tr>
<tr><td height="25" align="center"><%=rs("title")%></td></tr></table>
</td>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="page.asp?id=<%=rs("id")%>"><img src="<%=rs("firstImageName")%>" width="200" height="285" border="0" /></a></td>
</tr>
<tr><td height="25" align="center"><%=rs("title")%></td></tr></table>
</td>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询