急!!!行背景色交替变换,横行显示3条数据后自动换行!
请问下。为什么只有第一行的颜色变了。后面的就不变了呢?
<%
set rs_2 = server.createobject("adodb.recordset")
sql="select * from company where tjsq='2' order by id desc"
rs_2.open sql,conn,1,1
response.write"<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
if rs_2.bof and rs_2.eof then
response.write "<tr><td align='center'>暂无相关信息</td></tr>"
else
for g = 1 to 9
if g mod 2 = 0 then
bgcolor="#F2F7FD"
else
bgcolor="#ffffff"
end if
rs_2.movenext
next
response.write"<tr bgcolor="&bgcolor&">" '为什么只有第一行变色,后面的就不变了呢?
for i=1 to 9
if rs_2.eof then exit for
response.write"<td width='33%' height='23'>"
if Len(rs_2("gsname"))<=14 then
NewsName=rs_2("gsname")
else
NewsName=Left(rs_2("gsname"),12)&"..."
end if
response.write "<table ><tr><td align=left> <IMG width=6 height=7 src='Images/zptu.gif'> <a href=zcfgview.asp?ID="&rs_2("id")&" target=_blank title="&rs_2("gsname")&">"&NewsName&"</a></td>"
response.Write "</tr></table >"
response.write"</td>"
if i mod 3 = 0 then '每行显示3条数据。
response.write"</tr>"
end if
rs_2.movenext
next
end if
response.write "</table>"
rs_2.close
set rs_2=nothing
%>
...全文
相关推荐
js实现GridView单选效果自动设置交替行、选中行、鼠标移动行背景色
使用js实现GridView单选效果自动设置交替行、选中行、鼠标移动行背景色
MFC之CMFCPropertyGridCtrl 重写控件实现自定义行颜色交替变换
简述 CMFCPropertyGridCtrl集成了很多平常用的控件在里面,包括:复选框、静态文本框、按钮、文件资源管理器、颜色选择等控件,其主要通过CMFCPropertyGridProperty对象添加;但是CMFCPropertyGridCtrl也有不足的地方,就是它不像CListControl一样可以交替显示行颜色,所以在有这种需求的基础上做了相对应的一些更改来达到行颜色...
用javascript css实现GridView行背景色交替、鼠标划过行变色,点击行变色选中
前几天在博问里发现有人问关于 GridView点击行变色 的问题,突然想起很久很久以前,写过一篇文章 一个简单但常用的表格样式--鼠标划过行变色--简洁实现 ,是关于表格行颜色交替和鼠标指向时变色的,正好今天把那一篇补充和扩展一下
asp下制做行背景颜色交替变换的表格
asp下制做行背景颜色交替变换的表格
sheetJs+xlsx-style——前端实现导出excel表格——设置单元格背景色,居中,自动换行,宽度,百分数展示等
sheetJs+xlsx-style——前端实现导出excel表格——设置单元格背景色,居中,自动换行,宽度,百分数展示等


