| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 765 人关注过本帖
标题:下面的代码如何让它显示两行四列呢,哪位帮帮忙啊
只看楼主 加入收藏
angerzl
Rank: 1
等 级:新手上路
帖 子:122
专家分:0
注 册:2007-8-20
结帖率:100%
收藏
 问题点数:0 回复次数:2 
下面的代码如何让它显示两行四列呢,哪位帮帮忙啊
<table border="0" width="100%" cellspacing="0" cellpadding="6" >
            <tr>
              <%
    if (cstr(session("member_id"))="3") then nodisplay_sql=" and a.album_id not in (545,590)"
    Record_Count=select_single_value("select count(*) from images  where subject='album' and topic_id in (select album_id from album a where a.if_best='1' "+nodisplay_sql+")")
    sql="select  c.img_id,a.album_id,a.member_id,a.album_title,a.mini_img,b.nickname,c.img_filename,a.release_date from album a,members b,images c where a.member_id=b.member_id and c.subject='album' and a.album_id=c.topic_id and a.if_best='1'  "+nodisplay_sql+" "
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn
    RANDOMIZE
    i=1
    bound1=1
    bound2=round(Record_Count*(3/9))
    bound3=round(Record_Count*(4/9))
    bound4=round(Record_Count*(5/9))
    bound5=round(Record_Count*(6/9))
    bound6=round(Record_Count*(7/9))
    bound7=round(Record_Count*(8/9))
    bound8=Record_Count
    'response.write bound1&bound2&bound3&bound4&bound5&bound6&bound7&bound8&"<br>"
    'response.write Record_Count&" "&round((bound2-bound1)*RND()+bound1)&"   "&round((bound3-bound2)*RND()+bound2+1)&"   "&round((bound4-bound3)*RND()+bound3)&""&"<br>"
    pic1_num=round((bound2-bound1-1)*RND()+bound1)
    pic2_num=round((bound3-bound2-1)*RND()+bound2)
    pic3_num=round((bound4-bound3-1)*RND()+bound3)
    pic4_num=round((bound5-bound4-1)*RND()+bound4)
    pic5_num=round((bound6-bound5-1)*RND()+bound5)
    pic6_num=round((bound7-bound6-1)*RND()+bound6)
    pic7_num=round((bound8-bound7-1)*RND()+bound7)
    pic8_num=round((bound9-bound8-1)*RND()+bound8)
    'response.write pic1_num&"   "&pic2_num&"   "&pic3_num&""
    while not rs.EOF
      'response.write rs("img_id")&"<br>"
      if (i=pic1_num) or (i=pic2_num) or (i=pic3_num) or (i=pic4_num)or (i=pic5_num)or (i=pic6_num)or (i=pic7_num)or (i=pic8_num)then
     %>
              <td width="25%" height="1"><table width="150" height="190" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td bgcolor="#F7F5EE"><TABLE width=1 border=0 align="center" cellPadding=0 cellSpacing=0>
                        <TBODY>
                        <TD>         
                        <TR>
                          <TD bgColor=#ffffff><TABLE cellSpacing=0 cellPadding=0 border=0>
                              <TBODY>
                                <TR>
                                  <TD onMouseOver="this.style.backgroundColor='#B8C5CD';return true;" onMouseOut="this.style.backgroundColor='#ffffff';"><TABLE cellSpacing=0 cellPadding=2 width="100%"
                                border=0>
                                      <TBODY>
                                        <TR>
                                          <TD><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                                              <TBODY>
                                                <TR>
                                                  <TD align=center><a href="album_detail.asp?album_id=<%=rs("album_id")%>"> <img border="0" src="doc_img/album/<%=rs("mini_img")%>" alt="作者:<%=rs("nickname")%>"></a></TD>
                                                </TR>
                                              </TBODY>
                                          </TABLE></TD>
                                        </TR>
                                      </TBODY>
                                  </TABLE></TD>
                                </TR>
                              </TBODY>
                          </TABLE></TD>
                        </TR>
                    </TABLE></td>
                  </tr>
                  <tr>

                    <td height="20" align="center"><a href="album_detail.asp?album_id=<%=rs("album_id")%>"><%=rs("album_title")%></a></td>
                  </tr>
              </table></td>
              <%
     end if
     i=i+1  
     rs.movenext
    Wend
    rs.close
    set rs=nothing
    %>
            </tr>
          </table>
搜索更多相关主题的帖子: 代码 
2008-11-18 10:10
angerzl
Rank: 1
等 级:新手上路
帖 子:122
专家分:0
注 册:2007-8-20
收藏
得分:0 
<%
     end if
     i=i+1  
     rs.movenext
    Wend
    rs.close
    set rs=nothing
    %>

这段要怎么改呢
如果用下面那段,它老提示“wend”不对…………,谁能帮我看看啊

 <%
        if i=4 then
          response.write "</tr>"
          i=0
        end if
                i=i+1

        rs.movenext
        Wend
            if i<>1 then
                for j=i to 4
                              %>

[[it] 本帖最后由 angerzl 于 2008-11-18 11:06 编辑 [/it]]
2008-11-18 11:04
非常挥舞
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-11-20
收藏
得分:0 
供你参考一下!
<%
              dim i
              i=0
coolsql = "SELECT top 8 * FROM soft where hot=1 ORDER BY id DESC"
Set coolrs = Server.CreateObject("ADODB.Recordset")
coolrs.OPEN coolsql,Conn,1,1
  if coolrs.bof and coolrs.eof then
  response.write "<tr><td valign='middle' align='center'>没有任何图片加入</td></tr>"
  else
do while not coolrs.eof
if i mod 4=0 and i<>0 then response.write "</tr><tr>"
i=i+1
%>
2008-11-20 16:25
快速回复:下面的代码如何让它显示两行四列呢,哪位帮帮忙啊
数据加载中...
 
   



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

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