asp图片循环 标题的显示问题

来源:百度知道 编辑:UC知道 时间:2024/06/11 03:07:45
我在网上找了代码,图片能显示并横向滚动,但我想我图片的标题在图片的左方或下方显示出来,但是不知为什么图片左方显示的时候一行只能显示2个字,至于在图片下方显示标题自己没实现,希望高手给指点,当然直接改成功了更好,打完加分,代码如下:
<table width="100%" height="75" background="../images/lm_g.jpg"border="1" cellspacing="0">
<tr>
<td height="85"><%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from pic order by pic_id desc",conn,1,3
%>
<div id="demo" style="overflow:hidden;width:790px;color:#ffffff;">
<table cellpadding="0" cellspacing="0" height=10 border="0">
<tr><td id="demo1" valign="top" align="center">
<table border="0" cellpadding="5" width="200"cellspacing="0">
<tr align="left">
<%
for i=0 to 5 <

正是因为你数据库里面记录数少所以才会出现循环停止的现象 增加些记录就好了
还有就是你的这种写法网页打开的速度会变慢的 table尽量要少用 因为它影响速度 最好还是用CSS的说

以下IIS-5.1测试通过

<table width="100%" height="75" background="../images/lm_g.jpg"border="1" cellspacing="0">
<tr>
<td height="85">
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from pic order by pic_id desc",conn,1,3
%>
<div id="demo" style="overflow:hidden;width:790px;color:#ffffff;">
<table cellpadding="0" cellspacing="0" height=10 border="0">
<tr>
<td id="demo1" valign="top" align="center">
<table border="0" cellpadding="5" width="200"cellspacing="0">
<tr align="left">
<%
for i=0 to 5
if rs.b