在下面的代码中,怎样才能实现横向和纵向的循环(比如:3行2列)?多谢!
<!--#include file="connW.asp" --><%
Set ad = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 5 * from yhgl ORDER BY id DESC"
ad.Open sql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px}
-->
</style>
</head>
<body>
<table width="300" border="1" cellspacing="0" cellpadding="0">
<%
if ad.EOF and ad.BOF then
response.write
else
Do Until ad.EOF %>
<tr>
<td align="center"><%= ad("name") %></td>
<td align="center"><%= ad("sex") %></td>
<td align="center"><%= ad("QQ") %></td>
</tr>
<% ad.MoveNext
Loop
end if
%>
</table>
</body>
</html>