如何控制内容显示几行几列?
我想让内容以2行2列显示,但是总是不能很好的控制,结果是总以两列显示,但是是以左边3个右边一个的结果显示,代码如下:<%set rs=server.CreateObject("adodb.recordset")sql="select * from SMT_cp where SMT_ypxxone_id="& ypxxoneid &" and SMT_ypxxtwo_id="& ypxxtwoid &" and SMT_key1=1 and SMT_key2=1 order by SMT_date desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<table><tr><td height=25 colspan=5 align=center bgcolor=#ffffff>暂无内容</td></tr></table>"
else
'分页的实现
listnum=4
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
%>
<table align="center">
<tr>
<%
do while not rs.eof and i<listnum
ypid=rs("SMT_yp_id")
set rscom=server.CreateObject("adodb.recordset")
sql="select * from SMT_company where SMT_id="& ypid
rscom.open sql,conn,1,1
comname=rscom("SMT_comname")
rscom.close
%>
<td height="125" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="189" rowspan="3" align="center" valign="top"><img src="user/upload/<%=rs("SMT_pic")%>" width="115" height="115"></td>
<td width="651" height="25" valign="middle" class="c4">?产品名称:<strong><a href="nj_products_detail.asp?id=<%=rs("SMT_id")%>"><%=rs("SMT_cpname")%></a></strong></td>
</tr>
<tr>
<td height="25" valign="middle">?公司名称:<font color="#FF0000"><%=comname%></font></td>
</tr>
<tr>
<td height="75" valign="middle">????<%=rs("SMT_cpjm")%></td>
</tr>
</table></td>
<%if i mod 2<>0 then response.write("<td width=10></td>") end if
if i mod 2=0 and j<>i then
response.write"</tr><tr>"
end if
rs.movenext
i=i+1
j=j-1
loop%>
</tr>
</table>
结果可以参考http://www.增压器这个网址
[[it] 本帖最后由 zhy328 于 2008-3-8 09:27 编辑 [/it]]