| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 960 人关注过本帖
标题:重复区域问题
只看楼主 加入收藏
wujiawen312
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-6-11
收藏
 问题点数:0 回复次数:3 
重复区域问题



我想做到这个效果,就是横向重复2次后换行..显示4条记录!请问这个怎样做!简单点.弄点说明好吗?
<%
        sql = "SELECT * FROM ZJnews ORDER BY postdate desc"   
                     Set rs = Server.CreateObject("ADODB.Recordset")  
                     rs.OPEN sql,Conn,1,1
                     %>
                        

                        
                        
                        
                        

                    <table width="280" height="96" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="99" rowspan="3" align="center" valign="middle"><img name="pImg" src='<%="./images/"&rs("picture")%>' width="90" height="90" alt=""></td>
                        <td width="148" height="20" align="center" valign="middle"><%=rs("ZJname")%></td>
                        <td width="33">&nbsp;</td>
                      </tr>
                      <tr>
                        <td height="20" align="center" valign="middle"><%=rs("cbdate")%></td>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td align="left" valign="top"><%=rs("jieshao")%></td>
                        <td>&nbsp;</td>
                      </tr>
                    </table>
                    
<%rs.movenext
'loop
rs.close
set rs=nothing
%>
搜索更多相关主题的帖子: 区域 效果 记录 
2008-06-26 10:55
robinbest
Rank: 1
等 级:新手上路
威 望:2
帖 子:213
专家分:0
注 册:2007-9-13
收藏
得分:0 
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
        <%
        sql = "SELECT * FROM ZJnews ORDER BY postdate desc"   
        Set rs = Server.CreateObject("ADODB.Recordset")  
        rs.OPEN sql,Conn,1,1
        i=1
        Do While (Not rs.eof)     
        %>
        <table width="280" height="96" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="99" rowspan="3" align="center" valign="middle">
               <img name="pImg" src='<%="./images/"&rs("picture")%>' width="90" height="90" alt=""></td>
            <td width="148" height="20" align="center" valign="middle"><%=rs("ZJname")%></td>
            <td width="33"> </td>
        </tr>
        <tr>
            <td height="20" align="center" valign="middle"><%=rs("cbdate")%></td>
            <td> </td>
        </tr>
        <tr>
            <td align="left" valign="top"><%=rs("jieshao")%></td>
            <td> </td>
        </tr>
        </table>
        <%
        if i mod 2 = 0 then response.write"</tr><tr>"
        i=i+1
        rs.movenext
        'loop
        %>        
    </td>
  </tr>
</table>               
<%
rs.close
set rs=nothing
%>

[[it] 本帖最后由 robinbest 于 2008-6-26 12:41 编辑 [/it]]
2008-06-26 12:38
wujiawen312
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-6-11
收藏
得分:0 
好像不行阿.~是竖着来读出的..~咋办?!
2008-06-26 17:23
gdk2006
Rank: 4
等 级:业余侠客
威 望:8
帖 子:928
专家分:270
注 册:2006-7-2
收藏
得分:0 
<table width="306" border="0" align="center" cellpadding="0" cellspacing="4">
  <tr>
  <%
  num=0
  for i=0 to 5
  %>
    <td width="304">

<table width="140" border="0" align="center" cellpadding="0" cellspacing="2">
  <tr>
    <td width="100" align="center" valign="middle" style="border:#000000 1px solid;"><img src="images/Article_title_icon.gif" width="100" height="100" /></td>
    <td width="20">&nbsp;</td>
  </tr>
  <tr>
    <td height="40" align="center">X-Man</td>
    <td>&nbsp;</td>
  </tr>
</table>

 </td>
 <%
 num=num+1
 if (num mod 3)=0 then
 response.Write("</tr>")
 response.Write("<tr>")
 end if
 %>
 <%
 next
 %>
  </tr>
</table>

自己去修改!

程序员的悲哀如何找女朋友?
追女解决方案百度“让她着迷”!
2008-06-27 08:44
快速回复:重复区域问题
数据加载中...
 
   



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

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