asp循环输出表格的问题

来源:百度知道 编辑:UC知道 时间:2024/05/21 16:27:27
以下是代码:<%
m=0
MaxList=9
set rs=conn.execute("SELECT * FROM MusicList where classid=36 order by id desc") '打开数据库中的表 字段

if not Rs.eof then如果记录指针没有到结尾 说明有数据记录
do while not rs.eof'开始循环 直到记录结尾
m=m+1'm加1代入m

%>
<tr>
<tr>
<td width="1"><input type="checkbox" name="songid" value="<%=rs(0)%>"></td>
<td height="1"><a href='<% if request("ms") <> "a" then %>p/<%=rs(0)%>.html<%else if rs("musictype")="1" then%>play.asp<%else%>play_me.asp<%end if%>?

songid=<%=rs(0)%><%end if%>' target="c" title='舞曲名称:<%=rs("musicname")%>'><% if rs("IsGood")=true then %><font color="#FF0000"><%=left(rs

("MusicName"),12)%&g

我没看你的代码..太累了..
<%for i=1 to10%>
</tr>
<td>1</td><td>2</td><td>3</td>
<tr>
<%next%>
把上面代码保存进一个asp文件执行试试
<tr>标签就是换行
希望这是你要的答案.

在...<% if len(rs("MusicName"))>3 then Response.Write "." %></a></td>之后加上"<td>......</td>"(你的原表是二列,想变四列就加两个<td>......</td>)
......是你要单元格内的内容

<table width=500 border=1>
<tr>
<%for i=1 to 23%>
<td>a</td>
<%
j=j+1
if j=3 then '在这里可设定,经过几个TD就换行

response.write "</tr><tr>"
j=0
end if

next
%>
</table>

给个原型你...看后应该能用上的了
主要就是到第三个TD时,再加上TR了