首页调用的代码是这样的 <script language='JavaScript' type='text/JavaScript' src='article_js.asp?ClassID=40&IncludeChild=false&SpecialID=0&ArticleNum=20&ShowType=1&ShowCols=2&ShowProperty=true&ShowClassName=false&ShowIncludePic=false&ShowTitle=true&ShowUpdateTime=false&ShowHits=false&ShowAuthor=false&ShowHot=true&ShowMore=true&TitleMaxLen=50&ContentMaxLen=30&Hot=false&Elite=false&UsePage=true&DateNum=&OrderField=ArticleID&OrderType=desc'>
  </script>
要如何才能实现内容分两栏显示
article_js.asp里面,cols的代码是这样写的   
if((i mod showcols=0)and(not rs.eof))then
 str=str & "</tr><tr valign='top'>"  
  end if  
我在调用代码中设置了showcols=0 和等于1到10都没有分栏的效果,是哪里写错了。

解决方案 »

  1.   

    if((i mod showcols==0)and(not rs.eof))then
    是不是==啊
      

  2.   

    <table>
    <%
    '数据集:Rs
    i=0
    do while not rs.eof
    i=i+1
    if i mod 2 = 1 then
    %>
    <tr>
    <%
    end if
    %>
    <td>这里放内容</td>
    <%
    if i mod 2 = 0 then
    Response.Write("</tr>")
    else
    Response.Write("<td></td></tr>")
    end if
    %>
    <%
    rs.movenext
    loop
    %>
    </table> 
      

  3.   

    <%
    showcols=2
    i=0
    if not rs.eof then
      i=i+1
      str=str & "<td>" & rs("某字段") & "</td>"
      if i mod showcols=0 then
         str=str & "</tr><tr valign='top'>"   
      end if
    end if
    %>
      

  4.   

    <%
    showcols=2
    i=0
    if not rs.eof then
      i=i+1
      str=str & "<td>" & rs("某字段") & "</td>"
      if i mod showcols=0 then
         str=str & "</tr><tr valign='top'>"   
      end if
      rs.movenext
    end if
    str=str & "</tr></table>"   
    %>