| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 916 人关注过本帖
标题:请问能横排显示一个table里面的数据吗?
只看楼主 加入收藏
sjzfls
Rank: 1
等 级:新手上路
帖 子:119
专家分:0
注 册:2007-5-11
结帖率:0
收藏
 问题点数:0 回复次数:2 
请问能横排显示一个table里面的数据吗?
[bo]如何横排显示数据?[/bo]
如题,以下是我的 index.asp 代码, 我现在的图片和一些数据都包括在了一个表格里~~

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

现在的代码是每页显示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
%>
[bo]<table width="160" border="0" cellpadding="0" cellspacing="0">[/bo]
                    <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>
                  [bo]</table>[/bo]
<%
rs.movenext
loop
end if
%>
搜索更多相关主题的帖子: table 数据 表格 代码 index 
2008-03-25 16:33
wuchunyu120
Rank: 1
来 自:河南南阳
等 级:新手上路
帖 子:237
专家分:0
注 册:2007-10-29
收藏
得分:0 
定义
<%
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-03-25 16:41
sjzfls
Rank: 1
等 级:新手上路
帖 子:119
专家分:0
注 册:2007-5-11
收藏
得分:0 
具体位置应该放到哪啊~~ 请教~~~
2008-03-25 16:47
快速回复:请问能横排显示一个table里面的数据吗?
数据加载中...
 
   



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

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