我想在asp里把图片每行显示5个,下面有代码,麻烦路过的高人给指点一下,麻烦高手在我的给的代码的基础上
<%@LANGUAGE="VBSCRIPT"CODEPAGE="65001"%><!--#includefile="Connections/ggx.asp"--><%Di...
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/ggx.asp" -->
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_ggx_STRING
rs1_cmd.CommandText = "SELECT * FROM info_total"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>repeat</title>
<style type="text/css">
<!--
.STYLE2 {font-size: 13px}
-->
</style>
</head>
<body>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<table width="146" height="166" border="0">
<tr>
<td width="132" height="115"><img src="manage/<%=(rs1.Fields.Item("pic_path").Value)%>" alt="" width="140" height="130" /></td>
</tr>
<tr>
<td height="22"><span class="STYLE2"><%=(rs1.Fields.Item("info_name").Value)%></span></td>
</tr>
<tr>
<td><span class="STYLE2"><%=(rs1.Fields.Item("info_content").Value)%></span></td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
急用!哪位高手如果可以及时修改,有重谢,请一定按要求修改!!!拜谢了! 展开
<!--#include file="Connections/ggx.asp" -->
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_ggx_STRING
rs1_cmd.CommandText = "SELECT * FROM info_total"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>repeat</title>
<style type="text/css">
<!--
.STYLE2 {font-size: 13px}
-->
</style>
</head>
<body>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<table width="146" height="166" border="0">
<tr>
<td width="132" height="115"><img src="manage/<%=(rs1.Fields.Item("pic_path").Value)%>" alt="" width="140" height="130" /></td>
</tr>
<tr>
<td height="22"><span class="STYLE2"><%=(rs1.Fields.Item("info_name").Value)%></span></td>
</tr>
<tr>
<td><span class="STYLE2"><%=(rs1.Fields.Item("info_content").Value)%></span></td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
急用!哪位高手如果可以及时修改,有重谢,请一定按要求修改!!!拜谢了! 展开
2个回答
展开全部
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/ggx.asp" -->
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_ggx_STRING
rs1_cmd.CommandText = "SELECT * FROM info_total"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>repeat</title>
<style type="text/css">
<!--
.STYLE2 {font-size: 13px}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
i=0
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<td> <table width="146" height="166" border="0">
<tr>
<td width="132" height="115"><img src="manage/<%=(rs1.Fields.Item("pic_path").Value)%>" alt="" width="140" height="130" /></td>
</tr>
<tr>
<td height="22"><span class="STYLE2"><%=(rs1.Fields.Item("info_name").Value)%></span></td>
</tr>
<tr>
<td><span class="STYLE2"><%=(rs1.Fields.Item("info_content").Value)%></span></td>
</tr>
</table></td>
<%
i=i+1
if i mod 5 = 0 then response.Write "</tr><tr>"
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</tr>
</table>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
可以通过修改if i mod 5后面的数字控制每行显示个数!
<!--#include file="Connections/ggx.asp" -->
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_ggx_STRING
rs1_cmd.CommandText = "SELECT * FROM info_total"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>repeat</title>
<style type="text/css">
<!--
.STYLE2 {font-size: 13px}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
i=0
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<td> <table width="146" height="166" border="0">
<tr>
<td width="132" height="115"><img src="manage/<%=(rs1.Fields.Item("pic_path").Value)%>" alt="" width="140" height="130" /></td>
</tr>
<tr>
<td height="22"><span class="STYLE2"><%=(rs1.Fields.Item("info_name").Value)%></span></td>
</tr>
<tr>
<td><span class="STYLE2"><%=(rs1.Fields.Item("info_content").Value)%></span></td>
</tr>
</table></td>
<%
i=i+1
if i mod 5 = 0 then response.Write "</tr><tr>"
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</tr>
</table>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
可以通过修改if i mod 5后面的数字控制每行显示个数!
展开全部
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/ggx.asp" -->
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_ggx_STRING
rs1_cmd.CommandText = "SELECT * FROM info_total"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>repeat</title>
<style type="text/css">
<!--
.STYLE2 {font-size: 13px}
-->
</style>
</head>
<body>
<table>
<%
dim colsIndex
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
response.write "<tr>"
for colsIndex = 1 to 5
if not rs1.eof then
response.write "<td><img src=""manage/"&(rs1.Fields.Item("pic_path").Value)&""" alt="""" width=""140"" height=""130"" /><br />"&rs1.Fields.Item("info_content").Value&"</td>"
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
else
response.write "<td> </td>"
end if
Next
response.write "</tr>"
Wend
%>
</table>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
<!--#include file="Connections/ggx.asp" -->
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_ggx_STRING
rs1_cmd.CommandText = "SELECT * FROM info_total"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>repeat</title>
<style type="text/css">
<!--
.STYLE2 {font-size: 13px}
-->
</style>
</head>
<body>
<table>
<%
dim colsIndex
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
response.write "<tr>"
for colsIndex = 1 to 5
if not rs1.eof then
response.write "<td><img src=""manage/"&(rs1.Fields.Item("pic_path").Value)&""" alt="""" width=""140"" height=""130"" /><br />"&rs1.Fields.Item("info_content").Value&"</td>"
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
else
response.write "<td> </td>"
end if
Next
response.write "</tr>"
Wend
%>
</table>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询