请教如何显示数据库的内容?

Miriamy 2005-11-18 03:02:11
取出数据库中有20条记录,有两列,左边列显示奇数行的个息,右边列显示偶数行的信息?
如何做?
...全文
67 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lnboy1003 2005-11-18
  • 打赏
  • 举报
回复
<tr>

<td><table>
<%
for i=1 to rs.recordcount

if rs("id") mod 2 = 1 then
%><tr><td>
<%=rs("id")%>
</td></tr>
<%
end if
rs.movenext
next
%>
</table></td>
<td><table>
<%
rs.movefirst
for i=1 to rs.recordcount

if rs("id") mod 2 = 0 then
%><tr><td>
<%=rs("id")%>
</td></tr>
<%
end if
rs.movenext
next
%>
</table></td>

</tr>
friendlyFour 2005-11-18
  • 打赏
  • 举报
回复
inti=1
Response.write "<table border=0>"
do while

if inti mod 2 = 1 then
response.write "<tr>"
end if
Response.write inti&"<td>"&rs("xxx")&"</td>"
if inti mod 2 = 0 then
response.write "</tr>"
end if
inti=inti+1
loop
Response.write "</table>"

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧