asp代码循环问题。
来源:百度知道 编辑:UC知道 时间:2024/08/22 14:23:21
以下代码只能在一行显示八个,我想显示两行每行四个,该怎么写。
function TopProducts()
dim rs,sql,i,ProductName,SmallPicPath
set rs = server.createobject("adodb.recordset")
sql="select ID,ProductName"&LangData&",SortID,SmallPic,GroupID,Exclusive from NwebCn_Products where ViewFlag"&LangData&" and NewFlag order by id desc"
rs.open sql,conn,1,1
response.write"<table width='100%' border='1' cellspacing='1' cellpadding='1'>"
response.write "<tr><td height='20'></td></tr>"
if rs.bof and rs.eof then
response.write "<tr><td align='center'>暂无相关信息</td></tr>"
else
response.write"<tr>"
for i=1 to 8
if rs.eof then exit for
response.write"<td width='25%'>"
if StrLen(rs("ProductName"&LangData))&
function TopProducts()
dim rs,sql,i,ProductName,SmallPicPath
set rs = server.createobject("adodb.recordset")
sql="select ID,ProductName"&LangData&",SortID,SmallPic,GroupID,Exclusive from NwebCn_Products where ViewFlag"&LangData&" and NewFlag order by id desc"
rs.open sql,conn,1,1
response.write"<table width='100%' border='1' cellspacing='1' cellpadding='1'>"
response.write "<tr><td height='20'></td></tr>"
if rs.bof and rs.eof then
response.write "<tr><td align='center'>暂无相关信息</td></tr>"
else
response.write"<tr>"
for i=1 to 8
if rs.eof then exit for
response.write"<td width='25%'>"
if StrLen(rs("ProductName"&LangData))&
看看如下代码,类似,你会明白
<table width="500" border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" class="productInfo">
<tr>
<td> </td>
</tr>
<tr >
<td> 点击小区名,即可选择. 如果没有请在查询框中输入您要建立的小区,点击建立 </td>
</tr>
<tr>
<td> 查询您所在小区:
<input type="text" name="textfield" />
<input type="submit" name="Submit" value="查询" />
<input type="submit" name="Submit2" value="建立" />
</td>
</tr>
<tr>
<td>全部区域:</td>
</tr>
<%
dim areaRs,areaSql,recordNum,m,n,u
set areaRs = server.createobject("adodb.r