asp 数据库查询后显示,如何自动换行?
下面的代码能够显示出现,都是竖着显示,。我想让他横着排后,每排显示5个就换行,如何修改下面的代码<%WithRs.Open"Select*FromB_AboutWhere...
下面的代码能够显示出现,都是竖着显示,。我想让他横着排后,每排显示5个就换行,如何修改下面的代码 <%
With Rs
.Open"Select * From B_About Where Type='qikan' Order By [Order] desc",Conn(),1,1
For i=1 To .Recordcount
If .Eof Then Exit For
%>
<table width="150" height="27" border="0" cellpadding="0" cellspacing="0" background="images/gk3.jpg" onmouseover="change(this.id,'images/gk2.jpg')" onmouseout="change2(this.id,'images/gk3.jpg')" class="xdh1" id="<%=Rs("ID")%>" style="margin-bottom:2px;">
<tr>
<td align="left" style="padding-left:25px;"><a href="qikan.asp?id=<%=Rs("ID")%>" class="jiaoshou"><%=Rs("Title")%></a></td>
</tr>
</table>
<%
.Movenext
Next
.Close
End With
%> 展开
With Rs
.Open"Select * From B_About Where Type='qikan' Order By [Order] desc",Conn(),1,1
For i=1 To .Recordcount
If .Eof Then Exit For
%>
<table width="150" height="27" border="0" cellpadding="0" cellspacing="0" background="images/gk3.jpg" onmouseover="change(this.id,'images/gk2.jpg')" onmouseout="change2(this.id,'images/gk3.jpg')" class="xdh1" id="<%=Rs("ID")%>" style="margin-bottom:2px;">
<tr>
<td align="left" style="padding-left:25px;"><a href="qikan.asp?id=<%=Rs("ID")%>" class="jiaoshou"><%=Rs("Title")%></a></td>
</tr>
</table>
<%
.Movenext
Next
.Close
End With
%> 展开
1个回答
2014-03-15
展开全部
<%
With Rs
.Open"Select * From B_About Where Type='qikan' Order By [Order] desc",Conn(),1,1%>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<%For i=1 To .RecordcountIf .Eof Then Exit For
%> <td width="150" height="27" align="left" style="padding-left:25px;margin-bottom:2px;" background="images/gk3.jpg" onmouseover="change(this.id,'images/gk2.jpg')" onmouseout="change2(this.id,'images/gk3.jpg')" class="xdh1" id="<%=Rs("ID")%>"><a href="qikan.asp?id=<%=Rs("ID")%>" class="jiaoshou"><%=Rs("Title")%></a></td><%
if i mod 5 =0 then
%>
</tr><tr>
<%
end if
.Movenext
Next
%>
</tr>
</table>
<%.Close
End With
%>
With Rs
.Open"Select * From B_About Where Type='qikan' Order By [Order] desc",Conn(),1,1%>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<%For i=1 To .RecordcountIf .Eof Then Exit For
%> <td width="150" height="27" align="left" style="padding-left:25px;margin-bottom:2px;" background="images/gk3.jpg" onmouseover="change(this.id,'images/gk2.jpg')" onmouseout="change2(this.id,'images/gk3.jpg')" class="xdh1" id="<%=Rs("ID")%>"><a href="qikan.asp?id=<%=Rs("ID")%>" class="jiaoshou"><%=Rs("Title")%></a></td><%
if i mod 5 =0 then
%>
</tr><tr>
<%
end if
.Movenext
Next
%>
</tr>
</table>
<%.Close
End With
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询