asp表格换行问题,麻烦可否帮我改一下,我想表格内容两列输出,谢谢哈
<%dimNclasslie,sql,classlie,classid,idSetNclasslie=Server.CreateObject("ADODB.Records...
<%
dim Nclasslie,sql,classlie,classid,id
Set Nclasslie =Server.CreateObject("ADODB.Recordset")
sql="select * from FOX_class1"
Set classlie = Server.CreateObject("ADODB.Recordset")
classlie.open sql,conn,1,1
if not classlie.eof then
do while not classlie.eof
classid=classlie("id")%>
<tr>
<td width="42%"> <TABLE width="300" border=0 cellpadding="0" cellSpacing=1 style="border-collapse: collapse">
<TBODY>
<TR>
<TD height="24"> <table width="100%" border="0" cellpadding="0" cellspacing="0" id="table63">
<tr>
<td vAlign="bottom"> <img src="images/d2.gif" width="5" height="5" border="0">
<b> <a href=xinxilist.asp?class1=<%=classid%>&fox=1><font class="z4"><%=classlie("class1")%></font></a></b>
<%
dim rs
set rs=conn.execute("select count(id) from [FOX_xinxi] where ts=0 and class1="&classid&"")
%>
[<%=rs(0)%>]</td>
</tr>
</table></TD>
</TR>
<%
sql="select * from [FOX_class2] where class1="&classid
Nclasslie.open sql,conn,1,1
do while not Nclasslie.eof
%>
<%
loop
Nclasslie.Close
%>
</TBODY>
</TABLE></td>
</tr>
<%
classlie.movenext
loop
end if
classlie.close
set classlie=nothing
set Nclasslie=nothing
%>
啊。现在输出变成。
1
1 1
1 1
1 1
1 1
这样了。能解决吗?谢谢哈 展开
dim Nclasslie,sql,classlie,classid,id
Set Nclasslie =Server.CreateObject("ADODB.Recordset")
sql="select * from FOX_class1"
Set classlie = Server.CreateObject("ADODB.Recordset")
classlie.open sql,conn,1,1
if not classlie.eof then
do while not classlie.eof
classid=classlie("id")%>
<tr>
<td width="42%"> <TABLE width="300" border=0 cellpadding="0" cellSpacing=1 style="border-collapse: collapse">
<TBODY>
<TR>
<TD height="24"> <table width="100%" border="0" cellpadding="0" cellspacing="0" id="table63">
<tr>
<td vAlign="bottom"> <img src="images/d2.gif" width="5" height="5" border="0">
<b> <a href=xinxilist.asp?class1=<%=classid%>&fox=1><font class="z4"><%=classlie("class1")%></font></a></b>
<%
dim rs
set rs=conn.execute("select count(id) from [FOX_xinxi] where ts=0 and class1="&classid&"")
%>
[<%=rs(0)%>]</td>
</tr>
</table></TD>
</TR>
<%
sql="select * from [FOX_class2] where class1="&classid
Nclasslie.open sql,conn,1,1
do while not Nclasslie.eof
%>
<%
loop
Nclasslie.Close
%>
</TBODY>
</TABLE></td>
</tr>
<%
classlie.movenext
loop
end if
classlie.close
set classlie=nothing
set Nclasslie=nothing
%>
啊。现在输出变成。
1
1 1
1 1
1 1
1 1
这样了。能解决吗?谢谢哈 展开
2009-01-16
展开全部
<%
dim Nclasslie,sql,classlie,classid,id
Set Nclasslie =Server.CreateObject("ADODB.Recordset")
sql="select * from FOX_class1"
Set classlie = Server.CreateObject("ADODB.Recordset")
classlie.open sql,conn,1,1
if not classlie.eof then
dim flagX:flagX=1
do while not classlie.eof
classid=classlie("id")
flagX=flagX+1
if flagX mod 2 = 1 then response.write("<tr>")
%>
<td width="42%"> <TABLE width="300" border=0 cellpadding="0" cellSpacing=1 style="border-collapse: collapse">
<TBODY>
<TR>
<TD height="24"> <table width="100%" border="0" cellpadding="0" cellspacing="0" id="table63">
<tr>
<td vAlign="bottom"> <img src="images/d2.gif" width="5" height="5" border="0">
<b> <a href=xinxilist.asp?class1=<%=classid%>&fox=1><font class="z4"><%=classlie("class1")%></font></a></b>
<%
dim rs
set rs=conn.execute("select count(id) from [FOX_xinxi] where ts=0 and class1="&classid&"")
%>
[<%=rs(0)%>]</td>
</tr>
</table></TD>
</TR>
<%
sql="select * from [FOX_class2] where class1="&classid
Nclasslie.open sql,conn,1,1
do while not Nclasslie.eof
%>
<%
loop
Nclasslie.Close
%>
</TBODY>
</TABLE></td>
<%
if flagX mod 2 = 0 then response.write("<tr>")
classlie.movenext
loop
end if
classlie.close
set classlie=nothing
set Nclasslie=nothing
%>
dim Nclasslie,sql,classlie,classid,id
Set Nclasslie =Server.CreateObject("ADODB.Recordset")
sql="select * from FOX_class1"
Set classlie = Server.CreateObject("ADODB.Recordset")
classlie.open sql,conn,1,1
if not classlie.eof then
dim flagX:flagX=1
do while not classlie.eof
classid=classlie("id")
flagX=flagX+1
if flagX mod 2 = 1 then response.write("<tr>")
%>
<td width="42%"> <TABLE width="300" border=0 cellpadding="0" cellSpacing=1 style="border-collapse: collapse">
<TBODY>
<TR>
<TD height="24"> <table width="100%" border="0" cellpadding="0" cellspacing="0" id="table63">
<tr>
<td vAlign="bottom"> <img src="images/d2.gif" width="5" height="5" border="0">
<b> <a href=xinxilist.asp?class1=<%=classid%>&fox=1><font class="z4"><%=classlie("class1")%></font></a></b>
<%
dim rs
set rs=conn.execute("select count(id) from [FOX_xinxi] where ts=0 and class1="&classid&"")
%>
[<%=rs(0)%>]</td>
</tr>
</table></TD>
</TR>
<%
sql="select * from [FOX_class2] where class1="&classid
Nclasslie.open sql,conn,1,1
do while not Nclasslie.eof
%>
<%
loop
Nclasslie.Close
%>
</TBODY>
</TABLE></td>
<%
if flagX mod 2 = 0 then response.write("<tr>")
classlie.movenext
loop
end if
classlie.close
set classlie=nothing
set Nclasslie=nothing
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询