| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1327 人关注过本帖
标题:怎么让图片一行显示4个,分3行显示??分页
只看楼主 加入收藏
qq376636120
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-11-8
收藏
 问题点数:0 回复次数:4 
怎么让图片一行显示4个,分3行显示??分页
程序原代码

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn1.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "2"
If (Request("MM_EmptyValue") <> "") Then
  Recordset1__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn1_STRING
Recordset1.Source = "SELECT * FROM Ft_pic WHERE cat_id = " + Replace(Recordset1__MMColParam, "'", "''") + " ORDER BY pic_id DESC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>商丘市悦亚特种车辆制造有限公司</title>
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
.STYLE2 {color: #FFFFFF}
.STYLE4 {
    font-size: 14px;
    color: #FFFFFF;
    text-decoration: none;
}
.STYLE9 {font-size: 13px}
.STYLE11 {color: #FFFFFF; font-size: 14px; font-weight: bold; }
.STYLE12 {font-size: 12px}
a {
    font-family: 宋体;
    color: #FFFFFF;
    font-weight: bold;
    font-size: 14px;
}
a:link {
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #CCCCCC;
}
a:hover {
    text-decoration: none;
}
a:active {
    text-decoration: none;
    color: #000000;
}
.STYLE9 .STYLE9 {
    color: #000000;
    text-decoration: none;
}
.STYLE14 {font-size: 13px; color: #000000; }
.STYLE15 {color: #000000}
a:link {
    color: #000000;
    text-decoration: none;
}
a:visited {
    color: #333333;
    text-decoration: none;
}
body,td,th {
    color: #000000;
}
.style16 {font-size: 14px; color: #000000; text-decoration: none; }
-->
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('image/images/bbt .gif','image/images/bt1_02 2.gif','image/images/bt1_03 3.gif','image/images/bt1_04 4.gif','image/images/bt1_05 5.gif','image/images/bt1_06 6.gif','image/images/bt1_08 8.gif','image/images/bt1_077.gif','image/images/bt1_09 9.gif','image/images/bt1_11 11.gif')">
<table width="995" height="1000" border="0" align="center" cellspacing="0">
  <tr>
    <td height="84" colspan="5"><img src="image/top_1.jpg" width="994" height="82" /></td>
  </tr>
  <tr>
    <td height="30" colspan="5"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image21','','image/images/bbt .gif',1)"></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image21','','image/images/bbt .gif',1)"></a><a href="xwzx.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image22','','image/images/bt1_02 2.gif',1)"></a><a href="cpzs.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image23','','image/images/bt1_03 3.gif',1)"></a>
      <table width="1000" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="93" height="38" bgcolor="#FFFFFF"><a href="index1.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image32','','image/images/bbt .gif',1)"><img src="image/images/bt1_01.gif" name="Image32" width="93" height="38" border="0" id="Image32" /></a><a href="#"></a></td>
          <td width="93" bgcolor="#FFFFFF"><a href="xwzx.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image22','','image/images/bt1_02 2.gif',1)"><img src="image/images/bt1_02.gif" name="Image22" width="93" height="38" border="0" id="Image22" /></a></td>
          <td width="522" bgcolor="#FFFFFF"><a href="cpzs.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image23','','image/images/bt1_03 3.gif',1)"><img src="image/images/bt1_03.gif" name="Image23" width="92" height="38" border="0" id="Image23" /></a></td>
          <td width="36" bgcolor="#FFFFFF"><a href="scgy.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image24','','image/images/bt1_04 4.gif',1)"><img src="image/images/bt1_04.gif" name="Image24" width="82" height="38" border="0" id="Image24" /></a></td>
          <td width="36" bgcolor="#FFFFFF"><a href="xswl.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image25','','image/images/bt1_05 5.gif',1)"><img src="image/images/bt1_05.gif" name="Image25" width="84" height="38" border="0" id="Image25" /></a></td>
          <td width="36" bgcolor="#FFFFFF"><a href="jszl.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image26','','image/images/bt1_06 6.gif',1)"><img src="image/images/bt1_06.gif" name="Image26" width="85" height="38" border="0" id="Image26" /></a></td>
          <td width="36" bgcolor="#FFFFFF"><a href="khfk.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image27','','image/images/bt1_077.gif',1)"><img src="image/images/bt1_07.gif" name="Image27" width="89" height="38" border="0" id="Image27" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image27','','image/images/bt1_077.gif',1)"></a><a href="shfw.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image27','','image/images/bt1_08 8.gif',1)"></a></td>
          <td width="36" bgcolor="#FFFFFF"><a href="shfw.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image28','','image/images/bt1_08 8.gif',1)"><img src="image/images/bt1_08.gif" name="Image28" width="88" height="38" border="0" id="Image28" /></a></td>
          <td width="36" bgcolor="#FFFFFF"><a href="gsmp.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image29','','image/images/bt1_09 9.gif',1)"><img src="image/images/bt1_09.gif" name="Image29" width="83" height="38" border="0" id="Image29" /></a></td>
          <td width="36" bgcolor="#FFFFFF"><a href="lxwm.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image30','','image/images/bt1_10 10.gif',0)"><img src="image/images/bt1_10.gif" name="Image30" width="95" height="38" border="0" id="Image30" /></a></td>
          <td width="40" bgcolor="#FFFFFF"><a href="admin/admin_login.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image31','','image/images/bt1_11 11.gif',1)"><img src="image/images/bt1_11.gif" name="Image31" width="116" height="38" border="0" id="Image31" /></a></td>
        </tr>
      </table>      
    <a href="scgy.asp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image24','','image/images/bt1_04 4.gif',1)"></a></td>
  </tr>
  <tr>
    <td height="200" colspan="5"><span class="STYLE2"><span class="STYLE4">
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,19,0" width="994" height="225">
        <param name="movie" value="donghua/1.swf" />
        <param name="quality" value="high" />
        <embed src="donghua/1.swf" quality="high" pluginspage="http://www. type="application/x-shockwave-flash" width="994" height="225"></embed>
      </object>
    </span></span></td>
  </tr>
  <tr>
    <td height="15" colspan="5"><img src="image/top_5.jpg" width="994" height="13" /></td>
  </tr>
  <tr>
    <td width="215" rowspan="2"><table width="213" height="499" border="0" background="image/13.jpg">
      <tr>
        <td width="207" height="66"></td>
      </tr>
      <tr>
        <td height="427" align="center">
          <table width="201" border="0">
            <tr>
              <td width="55" valign="top">
                <div align="right"><img src="image/now.gif" width="12" height="9" vspace="8" align="top" /></div></td>
              <td width="81" height="27" align="center" valign="middle"><div align="justify"><span class="STYLE9"><a href="bangua.asp" target="_parent" class="STYLE11">半挂车系列</a></span></div></td>
              <td width="51" align="center">&nbsp;</td>
            </tr>
            <tr>
              <td><img src="image/now.gif" width="12" height="9" align="right" /></td>
              <td height="27" align="center"><div align="justify"><span class="STYLE9"><a href="xiangshi.asp" target="_parent" class="STYLE11">厢式车系列</a></span></div></td>
              <td height="27" align="center">&nbsp;</td>
            </tr>
            <tr>
              <td><img src="image/now.gif" width="12" height="9" align="right" /></td>
              <td height="27" align="center" nowrap="nowrap" class="STYLE14"><div align="justify"><a href="diping.asp" target="_parent" class="STYLE15">低平板车系列</a></div></td>
              <td height="27" align="center">&nbsp;</td>
            </tr>
            <tr>
              <td><img src="image/now.gif" width="12" height="9" align="right" /></td>
              <td height="27" align="center"><div align="justify"><span class="STYLE14"><a href="quangua.asp" target="_parent" class="STYLE9">全挂车系列</a></span></div></td>
              <td height="27" align="center">&nbsp;</td>
            </tr>
            <tr>
              <td><img src="image/now.gif" width="12" height="9" align="right" /></td>
              <td height="27" align="center"><div align="justify"><span class="STYLE9"><a href="peijian.asp" target="_parent" class="STYLE9">配件系列</a></span></div></td>
              <td height="27" align="center">&nbsp;</td>
            </tr>
            <tr>
              <td height="27" colspan="3"><img src="image/116.jpg" width="190" height="37" /></td>
              </tr>
            <tr>
              <td align="right"><span class="STYLE12">地址:</span></td>
              <td height="26" colspan="2" align="left"><span class="STYLE12">商丘市平台开发区豫</span></td>
              </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td height="23" colspan="2" align="left"><span class="STYLE12">园路北段</span></td>
            </tr>
            <tr>
              <td align="right"><span class="STYLE12">电话:</span></td>
              <td height="29" colspan="2" align="left"><span class="STYLE12">0370--3169199</span></td>
              </tr>
            <tr>
              <td align="right"><span class="STYLE12">传真:</span></td>
              <td height="32" colspan="2" align="left"><span class="STYLE12">0370--3169288 </span></td>
              </tr>
            <tr>
              <td align="right"><span class="STYLE12">开户:</span></td>
              <td height="25" colspan="2" align="left"><span class="STYLE12">建行商丘分行宋城支行</span></td>
              </tr>
            <tr>
              <td align="right"><span class="STYLE12">账号:</span></td>
              <td height="25" colspan="2" align="left"><span class="STYLE12">41001501619050000836</span></td>
              </tr>
            <tr>
              <td align="right"><span class="STYLE12">邮箱:</span></td>
              <td height="25" colspan="2" align="left"><span class="STYLE12">shangqiuyueya@
              </tr>
          </table>          </td>
      </tr>
      

    </table></td>
    <td width="780" height="74" colspan="3" align="left" valign="top"><div align="left"><img src="image/com_1.jpg" width="775" height="74" /></div></td>
  </tr>
  <tr>
    <td colspan="3" align="left" valign="top" bgcolor="#EBEFF2">&nbsp;
      <a href="cpzsxx.asp?"></a>
      <table width="770" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="380" align="left" valign="top" bgcolor="#FFFFFF"><table width="100" border="0" cellpadding="1">
            <tr>
              <td align="center"><img src="<%=(Recordset1.Fields.Item("pic_pic").Value)%>" alt="" name="" width="100" height="80" /></td>
            </tr>
            <tr>
              <td align="center"><%=(Recordset1.Fields.Item("pic_name").Value)%></td>
            </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td height="6" colspan="5"><p><img src="image/top_5.jpg" width="994" height="13" /></p>      </td>
  </tr>
  <tr>
    <td height="3" colspan="5" ><table width="994" border="0" align="center" cellspacing="0">
        <tr>
          <td width="220"><img src="image/biaozhi5.jpg" width="220" height="98" /></td>
          <td width="750" align="center" background="image/foot1.gif"><p><span class="style16">商丘市悦亚特种车辆制造有限公司</span>&nbsp;<a href="longad.asp"></a></p>
          <p><span class="style16">地址:商丘市平台开发区豫园路北段 电话:0370--3169199 传真:0370--3169288 </span></p></td>
          <td width="18" align="left"><div align="left"><img src="image/foot2.jpg" width="11" height="98" /></div></td>
        </tr>
      </table>      <p>&nbsp;</p></td>
  </tr>
</table>
</body>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
搜索更多相关主题的帖子: asp图片显示 
2008-11-15 11:07
multiple1902
Rank: 8Rank: 8
等 级:贵宾
威 望:42
帖 子:4881
专家分:671
注 册:2007-2-9
收藏
得分:0 
就不能不用DW生成代码么
2008-11-15 19:48
luo123
Rank: 1
等 级:新手上路
威 望:2
帖 子:324
专家分:0
注 册:2007-4-13
收藏
得分:0 
原帖:http://www.

以前自己做的一个图片按行格式输出
asp编程, 以下是用asp写的图片显示函数,可以实现图片按行有规则的输出。

<%
sql2="select *  from Product where ok=true order by id desc "
Set oRS= Server.CreateObject("ADODB.recordset")
oRS.Open sql2,conn,1,3
 if NOT oRS.EOF then
for i=1 to 4
  if NOT oRS.EOF then
   %>
<TABLE align=left border=0>
  <TBODY>
  <TR>
  <TD height=150 width=150 class="bg"><A href="productview.asp?id=<%=oRS("id")%>" target="_blank"><img src="<%=oRS("ProductImages")%>" height=148
 width=148 border="0"></A></TD></TR><tr><td><FONT color=#8dc938><%=oRS("ProductName")%></FONT></td>
                                    </tr>
                                  </TBODY>
                                </TABLE>
                              
  <%
oRS.MoveNEXT
end if
next
else Response.Write ("暂无内容.") end if
oRS.close
Set oRS = Nothing
%>

[url=http://www..cn]电子编程[/url]
2008-11-15 22:28
luo123
Rank: 1
等 级:新手上路
威 望:2
帖 子:324
专家分:0
注 册:2007-4-13
收藏
得分:0 
LZ你按自己要求改进一下就可以用  你试一下这样:
<%
sql2="select *  from Product where ok=true order by id desc "
Set oRS= Server.CreateObject("ADODB.recordset")
oRS.Open sql2,conn,1,3
if NOT oRS.EOF then
response.write "<table>"
for j=1 to 3
response.write "<tr>"
for i=1 to 4
  if NOT oRS.EOF then
   %>
<TABLE align=left border=0>
  <TBODY>
  <TR>
  <TD height=150 width=150 class="bg"><A href="productview.asp?id=<%=oRS("id")%>" target="_blank"><img src="<%=oRS("ProductImages")%>" height=148
width=148 border="0"></A></TD></TR><tr><td><FONT color=#8dc938><%=oRS("ProductName")%></FONT></td>
                                    </tr>
                                  </TBODY>
                                </TABLE>
                              
  <%
oRS.MoveNEXT
end if
next
response.write "</tr>"
next
response.write "</table>"
else Response.Write ("暂无内容.") end if
oRS.close
Set oRS = Nothing
%>

[[it] 本帖最后由 luo123 于 2008-11-15 22:36 编辑 [/it]]

[url=http://www..cn]电子编程[/url]
2008-11-15 22:30
xmuer
Rank: 1
等 级:新手上路
帖 子:236
专家分:0
注 册:2007-5-10
收藏
得分:0 
ASP实现N行M列分页代码
ASP实现N行M列分页代码

http://www.
2008-11-16 09:32
快速回复:怎么让图片一行显示4个,分3行显示??分页
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022862 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved