我有个例子,不过是用ASP做的
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="Ntable" >
<%
if not rs.eof then
rs.absolutepage=pageno '将指针移至指定页的第一条记录
loopno=pmcount
temp1 = 1
do while not rs.eof and loopno>0
Product = rs("Product")
Price = rs("Price")
select case temp1
case 1 temp1 = temp1+1
%>
<tr>
<td width="35%" valign="top" ><img src="images/icon3.gif" width="12" height="11"> </td>
<td width="10%"><span class="font12"><font color="#FF0000">¥</font></span>:</td>
<td width="10%"> </td>
<%
case 2 temp1 = temp1-1
%>
<td width="35%"><img src="images/icon3.gif" width="12" height="11"> </td>
<td width="10%"><span class="font12"><font color="#FF0000">¥</font></span>:</td>
</tr>
<%
end select
rs.movenext
loopno=loopno-1
loop
if temp1 = 2 then
%>
<td width="35%"> </td>
<td width="10%"> </td>
</tr>
<%
end if
else
%>
<%
end if
rs.close
conn.close
set conn=nothing
set rs=Nothing
%>
</table>
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="Ntable" >
<%
if not rs.eof then
rs.absolutepage=pageno '将指针移至指定页的第一条记录
loopno=pmcount
temp1 = 1
do while not rs.eof and loopno>0
Product = rs("Product")
Price = rs("Price")
select case temp1
case 1 temp1 = temp1+1
%>
<tr>
<td width="35%" valign="top" ><img src="images/icon3.gif" width="12" height="11"> </td>
<td width="10%"><span class="font12"><font color="#FF0000">¥</font></span>:</td>
<td width="10%"> </td>
<%
case 2 temp1 = temp1-1
%>
<td width="35%"><img src="images/icon3.gif" width="12" height="11"> </td>
<td width="10%"><span class="font12"><font color="#FF0000">¥</font></span>:</td>
</tr>
<%
end select
rs.movenext
loopno=loopno-1
loop
if temp1 = 2 then
%>
<td width="35%"> </td>
<td width="10%"> </td>
</tr>
<%
end if
else
%>
<%
end if
rs.close
conn.close
set conn=nothing
set rs=Nothing
%>
</table>
解决方案 »
- 第一次遇到这个问题?
- 我已经装了VS2008还能装VS6吗,需要有什么注意的?
- 上面红色的css,是啥意思?如何调用,谢谢
- asp.net如何让回车不激发按钮的click事件?
- 如何客户端控制 asp.net 控件 TreeView
- IIS中默认网站的端口改为:89 后,VS2005 打开网站后提示默认端口不对!应该如何配置开发环境啊?
- 关于Controls的用法,谢谢!
- 站点应用了FORM认证,如何让某一页不需要认证就可以访问?
- 高手们请进来一下,帮小弟解决一个问题,
- 如何完成datagrid的嵌套啊?
- c#类的方法中不能使用Response.Write吗?
- 思规---------你究竟是何方神圣???小弟对你的景仰就如滔滔江水,连绵不决
string Strings ="";
if(true){
Strings += "....";
}
else{
Strings += "....";
}