南强小屋 Design By 杰米
<%
Const adInteger = 3
Const adVarChar = 200 
' 声明变量
Dim myRecordset 
Dim iLetter     
Dim Field       
Dim strAltColor 
Dim bColor      
bColor = False

' 此例利用内存中的recordset,你需要做的只是修改你的数据显示的部分就可以了。
Set myRecordset = Server.CreateObject("ADODB.Recordset")
myRecordset.Fields.Append "ID", adInteger
myRecordset.Fields.Append "Title", adVarChar, 25
myRecordset.Fields.Append "Description", adVarChar, 255

myRecordset.Open

' Fill RS with sample data:
For iLetter = Asc("A") To Asc("M")
 myRecordset.AddNew
 myRecordset.Fields("ID").Value          = iLetter - 64
 myRecordset.Fields("Title").Value       = "字母:" & Chr(iLetter)
 myRecordset.Fields("Description").Value = "这里测试字母:" & Chr(iLetter) & "."
 myRecordset.Update
Next 'iLetter

'移动到头部开始位置,以便下面的循环开始.
myRecordset.MoveFirst


' 在表格中显示数据

Response.Write "<table border=""0"" cellspacing=""0"" cellpadding=""3"">" & vbCrLf

'表头
Response.Write vbTab & "<tr>" & vbCrLf
For Each Field in myRecordset.Fields
 Response.Write vbTab & vbTab & "<td bgcolor=""#CCCCCC""><strong>"
 Response.Write Field.Name
 Response.Write "</strong></td>" & vbCrLf
Next 'Field
Response.Write vbTab & "</tr>" & vbCrLf

Do While Not myRecordset.EOF
 ' 循环改变单元格的背景颜色
 bColor = Not bColor
 If bColor Then
  strAltColor = "#FFFFFF"
 Else
  strAltColor = "#FF8040"
 End If

 '循环改变单元格的背景颜色
 Response.Write vbTab & "<tr>" & vbCrLf
 For Each Field in myRecordset.Fields
  Response.Write vbTab & vbTab & "<td bgcolor="""
  Response.Write strAltColor
  Response.Write """>" & Field.Value & "</td>" & vbCrLf
 Next 'Field
 Response.Write vbTab & "</tr>" & vbCrLf

 myRecordset.MoveNext
Loop

' End the table
Response.Write "</table>" & vbCrLf

' 关闭对象、释放资源
myRecordset.Close
Set myRecordset = Nothing
%>

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

南强小屋 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
南强小屋 Design By 杰米

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

暂无asp下制做行背景颜色交替变换的表格的评论...

P70系列延期,华为新旗舰将在下月发布

3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。

而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?

根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。