| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付学习型 ASP/PHP/ASP.NET 主机 30元/年
高端软件开发 = 年薪十万不是梦赛孚耐:软件保护加密专家身份认证令牌USB KEY 
共有 405 人关注过本帖
标题:请问能横排显示一个table里面的数据吗?
收藏  订阅  推荐  打印 
sjzfls
Rank: 2
等级:注册会员
帖子:98
积分:1216
注册:2007-5-11
请问能横排显示一个table里面的数据吗?

如何横排显示数据?
如题,以下是我的 index.asp 代码, 我现在的图片和一些数据都包括在了一个表格里~~

我想让 每页显示 8个图片,2个一排(即横排显示加粗的table里面的数据)。

现在的代码是每页显示8个,都显示到一竖上了,请问如何修改呢?

即 把表格table里的

<table> 图片 </table>     

<table> 图片  </table>   

<table>图片 </table>     

<table>图片 </table>   
..........


改成

                             <table>图片 </table>        <table>图片 </table>   
                             <table>图片 </table>        <table>图片  </table>   
                             <table>图片  </table>        <table>图片 </table>  

显示.


我的具体代码:
<%
exec="select top 2 * from  newsinfo where [images]<>''and class=14 order by time desc "
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<%
if rs.eof and rs.bof then
response.write("暂时没有数据")
else
do while not rs.eof
%>
<table width="160" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="160" height="110" align="center" valign="middle"><table width="140" height="90" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                          <td align="center" valign="middle" background="images/picture_bg.gif"><table width="130" height="80" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td bgcolor="#333333"><img src="<%=Rs("images")%>" width="130" height="80"></td>
                                </tr>
                            </table></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td><table width="160" border="0" cellspacing="0" cellpadding="2" class=body_font>
                        <tr>
                          <td align="center"><strong><%=left(Rs("title"),10)%></strong></td>
                        </tr>
                      </table></td>
                    </tr>
                    <tr>
                      <td align="center"><table width="130" border="0" cellspacing="1" cellpadding="1">
                        <tr>
                          <td><table width="130" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                              <td bgcolor="#333333"><img name="" src="" width="1" height="1" alt="" style="background-color: #333333"></td>
                            </tr>
                          </table></td>
                        </tr>
                      </table></td>
                    </tr>
                    <tr>
                      <td><table width="160" border="0" cellspacing="0" cellpadding="5"  class=body_font>
                        <tr>
                          <td><%=left(Rs("content"),40)%></td>
                        </tr>
                      </table></td>
                    </tr>
                  </table>
<%
rs.movenext
loop
end if
%>
搜索更多相关主题的帖子: table  数据  表格  代码  index  
2008-3-25 16:33
wuchunyu120
Rank: 3Rank: 3
来自:河南南阳
等级:中级会员
帖子:233
积分:2560
注册:2007-10-29

定义
<%
ii=0
For i=1 To x
%>
然后调用的时候用一下
<%rs.movenext
ii=ii+1%>
<%if ii mod 2 =0 then%>
</tr>
<tr>
<%end if%>
<% next%>
end if%>
试试~
2008-3-25 16:41
sjzfls
Rank: 2
等级:注册会员
帖子:98
积分:1216
注册:2007-5-11

具体位置应该放到哪啊~~ 请教~~~
2008-3-25 16:47
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.054480 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved