标题:高手帮忙,ASP问题!
取消只看楼主
hinone
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-8-9
结帖率:0
已结贴  问题点数:20 回复次数:2 
高手帮忙,ASP问题!
我要在一行显示4个文章标题,数据库查询语句怎么写啊?我现在出来的是:在一列显示4个标题!现在的语法是:
 
                   <%
set rs=server.CreateObject("adodb.Recordset")
sql="select  name from kehu "
rs.open sql,conn,1,1
if rs.eof then%>
                  
    <tr>
                              <td height="8" align="center"><strong>暂无客户信息!</strong></td>
                            </tr>
                            <%else
do while not rs.eof
%>
                            <tr>
                              <td height="22"><img height="5" src="image/icon_dot01.gif" width="5">
                                <%if len(rs("name")) > 14 then Response.write left(rs("nema"),14)&"..." else Response.write rs("name") end if%>
                              </td>
                            </tr>
                            <%     
rs.movenext
loop
rs.close
set rs=nothing
end if%>              

请问应该怎么修改啊?让他一行显示4个文章标题!
搜索更多相关主题的帖子: ASP 
2010-08-09 11:57
hinone
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-8-9
得分:0 
试了,没用啊!能详细说明一下吗?谢谢!或者是让他生成的格式和表格一样,一行4条!
2010-08-09 13:17
hinone
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2010-8-9
得分:0 
<table width="94%" border="0" align="right" cellpadding="0" cellspacing="0">
                <tr>
                <%
set rs=server.CreateObject("adodb.Recordset")
sql="select  * from kh "
rs.open sql,conn,1,1
if rs.eof then%>
                  
    <tr>
                              <td height="8" align="center"><strong>暂无客户信息!</strong></td>
                            </tr>
                            <%else
do while not rs.eof
%>
                            <tr>
                              <td height="22"><img height="5" src="image/icon_dot01.gif" width="5">
                                <%if len(rs("name")) > 100 then Response.write left(rs("nema"),100)&"..." else Response.write rs("name") end if%>
                              </td>
                            <td>
                            <%     
rs.movenext
loop
rs.close
set rs=nothing
end if%>
</td>                  
</tr>                  
               
              </table>

这是我现在的写法!
现在显示的是
A
A
A
A
A
A
A
A
这样的,我想让他显示成
A A
A A
A A
A A
就是一个TABLE里,现在显示的是一列,我想让他变成,达到20条后,自动变成2列!高手帮忙啊,救命啊!
2010-08-10 19:20



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-315207-1-1.html




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

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