请教一下,怎样让图片横排3个显示?
现在是竖排..而且一排一个...
怎样让图片横排3个显示再竖排下去?
<%
set rs=server.createobject("adodb.recordset")
sql="select * from CompHonor order by id desc"
rs.open sql,conn,1,1
%>
<%
if not rs.eof then
i=0
do while not rs.eof
%>
<table width="88%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:10px; margin-bottom:10px;">
<tr>
<td
height="30" colspan="3"><img name="" src="../<%=rs("CompHonor")%>" width="189" height="120" alt=""></td>
<tr>
<td
height="42">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="5" colspan="3"></td>
</tr>
<td colspan="3" ><%=rs("explain")%> </td>
</table>
</td>
</tr>
<tr>
<td
height="1"><%
if totalput>0 then
call showpage(strFileName,totalput,MaxPerPage,false,true,"个产品")
end if
%> </td>
</tr>
</table>
<%
i=i+1
if i >= MaxPerpage then exit do
rs.movenext
loop
end if
%>
------解决方案--------------------<table border="0" align="center" cellpadding="0" cellspacing="5">
<tr>
<%
sql="SELECT * FROM abc' "
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
'上面3行 很明了定义SQL并打开表
if Not rs.eof then '如果又数据则
i=0 '赋值于I 为0 这里的i是为了下面的来一行多列显示数据而定义.
do while not rs.eof
i=i+1 '使用do while 循环的同时也给i 循环自动加1
%>
<td valign="top">这里显示数据内容</td>
<%
if i mod 4 <> 0 then '上面i+1 加到4时再整除4自然等于0这里更改一行显示的列数,这里是4列
response.write "<td width=""1""></td>"
else
response.write "</tr><tr>" '等于0则输出 换行和开始
end if
rs.movenext
loop
%>
</tr>
</table>
------解决方案--------------------<%
set rs=server.createobject("adodb.recordset")
sql="select * from CompHonor order by id desc"
rs.open sql,conn,1,1
%>
<table width="88%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:10px; margin-bottom:10px;">
<tr> <%
if not rs.eof then
i=0
do while not rs.eof
%>
<td
height="30" colspan="3"><img name="" src="../<%=rs("CompHonor")%>" width="189" height="120" alt=""></td>