注册 登录
编程论坛 ASP技术论坛

ASP数据横排出错大家帮我看看!!!

gaosuo 发布于 2008-04-27 20:21, 673 次点击
ASP数据横排出错大家帮我看看!!!
<body>
<div align="center">
<table border="1" width="800" id="table508" >
<tr>
<td style="font-size: 13px">
<div align="center">
<table border="0" width="800" id="table509" >
<tr>
<td width="9%" style="font-size: 13px">
<img border="0" src="images/arrow_3.gif" width="15" height="14"></td>
<td width="89%" style="font-size: 13px">
<img border="0" src="images/tjgg.jpg" width="150" height="22"></td>
</tr>
<tr>
<td colspan="2" style="font-size: 13px">
'以下是我要横排的内容:是个表格
<%
n=1
set rs=server.createobject("adodb.recordset")
sql="SELECT top 5 * from (SELECT * from gg where du='推荐' ORDER BY ID DESC)"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write ""
else
while not rs.eof
%>
<table border="0" width="230" id="table510" >
<tr>
<td rowspan="3" width="74" style="font-size: 13px">
<img border="0" src="<%=rs("tupian")%>" width="72" height="110"></td>
<td width="39" style="font-size: 13px">编号:</td>
<td style="font-size: 13px"><%=rs("id")%></td>
</tr>
<tr>
<td width="39" style="font-size: 13px">规格:</td>
<td style="font-size: 13px"><%=rs("guige")%></td>
</tr>
<tr>
<td width="39" style="font-size: 13px">信息:</td>
<td style="font-size: 13px">
<p align="center">
<a href="news.asp" style="text-decoration: none; color: #333">
<img border="0" src="<%=rs("xinxi")%>" width="75" height="25"></a>
</tr><%If n mod 3=0 Then%>
</table>
<%
end if
n=n+1
rs.movenext
wend
rs.close
end if
Set rts=Nothing
%>
'以上是我要横排的内容:是个表格
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
5 回复
#2
makebest2008-04-27 20:39
对的又是怎样的呢
#3
hxfly2008-04-28 00:04
TABLE和TABLE不能横排,....
#4
hxfly2008-04-28 00:05
<body>
<div align="center">
<table border="1" width="800" id="table508" >
<tr>
<td style="font-size: 13px">
<div align="center">
<table border="0" width="800" id="table509" >
<tr>
<td width="9%" style="font-size: 13px">
<img border="0" src="images/arrow_3.gif" width="15" height="14"></td>
<td width="89%" style="font-size: 13px">
<img border="0" src="images/tjgg.jpg" width="150" height="22"></td>
</tr>
<tr>
<td colspan="2" style="font-size: 13px">
'以下是我要横排的内容:是个表格
<%
n=1
set rs=server.createobject("adodb.recordset")
sql="SELECT top 5 * from (SELECT * from gg where du='推荐' ORDER BY ID DESC)"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write ""
else
%>
<table border="0" width="230" id="table510" >

<%
while not rs.eof
%>
<tr>
<td rowspan="3" width="74" style="font-size: 13px">
<img border="0" src="<%=rs("tupian")%>" width="72" height="110"></td>
<td width="39" style="font-size: 13px">编号:</td>
<td style="font-size: 13px"><%=rs("id")%></td>
</tr>
<tr>
<td width="39" style="font-size: 13px">规格:</td>
<td style="font-size: 13px"><%=rs("guige")%></td>
</tr>
<tr>
<td width="39" style="font-size: 13px">信息:</td>
<td style="font-size: 13px">
<p align="center">
<a href="news.asp" style="text-decoration: none; color: #333">
<img border="0" src="<%=rs("xinxi")%>" width="75" height="25"></a>
</tr>
<%
end if
n=n+1
rs.movenext
wend
rs.close
%>
</table>
<%
end if
Set rts=Nothing
%>
'以上是我要横排的内容:是个表格
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>

[[it] 本帖最后由 hxfly 于 2008-4-28 00:12 编辑 [/it]]
#5
hxfly2008-04-28 00:06
试试上面的代码....
#6
gaosuo2008-04-28 10:13
好的!!!我先试一下!谢你了!!
1