急!!!行背景色交替变换,横行显示3条数据后自动换行!

yuzhouer1122 yuzhouer1122 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
请问下。为什么只有第一行的颜色变了。后面的就不变了呢?


<%
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单选效果自动设置交替行、选中行、鼠标移动行背景色

weixin_38610870

MFC之CMFCPropertyGridCtrl 重写控件实现自定义行颜色交替变换

简述 CMFCPropertyGridCtrl集成了很多平常用的控件在里面,包括:复选框、静态文本框、按钮、文件资源管理器、颜色选择等控件,其主要通过CMFCPropertyGridProperty对象添加;但是CMFCPropertyGridCtrl也有不足的地方,就是它不像CListControl一样可以交替显示行颜色,所以在有这种需求的基础上做了相对应的一些更改来达到行颜色...

Ilson_

用javascript css实现GridView行背景色交替、鼠标划过行变色,点击行变色选中

前几天在博问里发现有人问关于 GridView点击行变色 的问题,突然想起很久很久以前,写过一篇文章 一个简单但常用的表格样式--鼠标划过行变色--简洁实现 ,是关于表格行颜色交替和鼠标指向时变色的,正好今天把那一篇补充和扩展一下

weixin_38742124

asp下制做行背景颜色交替变换的表格

asp下制做行背景颜色交替变换的表格

weixin_38660108

sheetJs+xlsx-style——前端实现导出excel表格——设置单元格背景色,居中,自动换行,宽度,百分数展示等

sheetJs+xlsx-style——前端实现导出excel表格——设置单元格背景色,居中,自动换行,宽度,百分数展示等

叶浩成520
评论 8
收藏 已收藏
分享
返回顶部
yuzhouer1122
ASP 28,401 成员 356,940 内容