![]() |
#2
netlin2012-08-24 22:52
楼主,对你的代码进行了一些补充,用红色字体标出了,你试试看:
Sub ShowLeftMenu() dim rs,ClassId ClassId=Request("ClassId") if ClassId="" then ClassId=8 End if set rs=Server.CreateObject("adodb.recordset") rs.open "select * from tbNewsSort where pid=2 ORder by SerialNum asc",Conn,1,1 if not rs.eof then i=1 do while not rs.eof if i mod 7=1 then if i=1 then response.write "<tr>" else response.write "</tr><tr>" if rs("id")=Cint(ClassId) then response.Write("<td class=""tab1"" align=""center"">") else response.Write("<td class=""tab2"" align=""center"">") end if 'response.Write("<div style=""margin-left:10px;"">") response.Write("<a href='Works.asp?ClassId="&rs("id")&"'>") 'response.Write("·") response.Write(rs("SortName")) response.Write("</a>") response.Write("</td>") 'response.Write("</div></td></tr>") & vbcrlf i=i+1 rs.movenext loop do while i mod 7<>1 if rs("id")=Cint(ClassId) then response.Write("<td class=""tab1"" align=""center"">&nbsp;</td>") else response.Write("<td class=""tab2"" align=""center"">&nbsp;</td>") end if i=i+1 loop response.write "</tr>" end if End Sub |
问题的图文阐述,图片地址:www.
那个按钮背景图是132x25像素,那一排可以用来显示内容的是905像素,网页总宽度是991像素
您能把代码写给我吗?我没有学过asp语言,不太懂
Sub ShowLeftMenu()
dim rs,ClassId
ClassId=Request("ClassId")
if ClassId="" then
ClassId=8
End if
set rs=Server.CreateObject("adodb.recordset")
rs.open "select * from tbNewsSort where pid=2 ORder by SerialNum asc",Conn,1,1
if not rs.eof then
do while not rs.eof
if rs("id")=Cint(ClassId) then
response.Write("<td class=""tab1"" align=""center"">")
else
response.Write("<td class=""tab2"" align=""center"">")
end if
'response.Write("<div style=""margin-left:10px;"">")
response.Write("<a href='Works.asp?ClassId="&rs("id")&"'>")
'response.Write("·")
response.Write(rs("SortName"))
response.Write("</a>")
response.Write("</td>")
'response.Write("</div></td></tr>") & vbcrlf
rs.movenext
loop
end if
End Sub