ASP中表格样式的问题

来源:百度知道 编辑:UC知道 时间:2024/09/20 19:33:36
我在ASP中用循环的方法调用新闻..
但是我调用出来每条新闻所在的表格背景色都一样的: 例如:
白色
白色
白色
白色
......
我觉得这样不好看
我想调用出来的表格背景色是 例如:
白色
黑色
白色
黑色
......

不知道怎样实现...请给出事例代码..谢谢

<%
for i = 0 to rs.RecordCount - 1
if i mod 2 = 0 then
tdbgcolor = \"#ffffff\"
else
tdbgcolor = \"#000000\"
end if
%>
<td bgcolor=\"<%=tdbgcolor%>\"></td>
<%
rs.MoveNext
next
%>

濂芥柟娉?鍚屾剰

支持矩阵设置,翻页的格式显示!
<%
sub showNews(sql,cols,rows,ipage,isShowBookMark,path)
dim rs,page_size,icol
if cols="" or not isNumeric(cols) then cols = 1
if cols<=0 then cols = 1
if rows="" or not isNumeric(rows) then rows = 1
if rows<=0 then rows=1
if ipage="" or not isNumeric(ipage) then ipage=1
if ipage<=0 then ipage=1

page_size = cols * rows
set rs = server.CreateObject("ADODB.recordset")
rs.open sql,conn,1,1
response.write "<table width=100% border=0 cell