是你的表格没搞对
你把浏览的HTML源代码放到Dreamweaver之类的编辑器里看看是个什么样。
你把浏览的HTML源代码放到Dreamweaver之类的编辑器里看看是个什么样。
俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www."> <HTML xmlns="http://www."> <HEAD><TITLE>菜单!</TITLE> <META http-equiv=Content-Type content="text/html; charset=gb2312"> <style type="text/css"> <!-- .wang500_1 { background-color: #006699; width: 498px; height: 30px; font-size: 14px; line-height: 30px; font-weight: bold; color: #FFFFFF; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: none; border-left-style: solid; border-top-color: #0066FF; border-right-color: #0066FF; border-bottom-color: #0066FF; border-left-color: #0066FF; } .wang500 { width: 498px; margin: 0px; padding: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0066FF; border-right-color: #0066FF; border-bottom-color: #0066FF; border-left-color: #0066FF; } .wang500 div { float: left; height: 25px; width: 150px; margin-left: 15px; line-height: 25px; }--> </style> </HEAD> <BODY> <div class="wang500_1">qqq</div> <div class="wang500"> <div><li>香烤鱼头王</li></div> <div><li>香烤鱼头王</li></div> <div><li>香烤鱼头王</li></div> <div><li>香烤鱼头</li></div> <div><li>香烤鱼头王</li></div> <div><li>香烤鱼头王</li></div> <div><li>香烤鱼头</li></div> <div><li>香烤鱼头王</li></div> <div><li>香烤鱼头王</li></div> <div><li>香烤鱼头王</li></div> <div><li>香烤鱼头</li></div> <div><li>香烤鱼头</li></div> </div> </BODY></HTML>你这样子试试,把数据库内容放在“<div><li>香烤鱼头王</li></div>”这里重复就行了。
<% Dim X_typestr X_typestr=Request.QueryString("typestr") Dim db,strSql,rs Set db=Server.CreateObject("ADODB.Connection") db.Open "Dsn=background" Set rs=Server.CreateObject("ADODB.Recordset") strSql="Select * From news where typestr ='鲁菜'order by id desc" rs.Open strSql,db,1 %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.> <HTML xmlns="http://www.> <HEAD><TITLE></TITLE> <META http-equiv=Content-Type content="text/html; charset=gb2312"> <style type="text/css"> <!-- .wang500 { width: 508px; margin: 0px; padding: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #1f92ff; border-right-color: #1f92ff; border-bottom-color: #1f92ff; border-left-color: #1f92ff; } .wang500 div { float: left; height: 25px; width: 148px; margin-left: 15px; line-height: 25px; }--> </style> </HEAD> <BODY> <table cellspacing="0" cellpadding="0" width="510" background="../images/tu_di.gif" border="0"> <tr> <td width="7"><img height="29" src="../images/tu(1).gif" width="7" /></td> <td ><font color="#ffffff"><b>列表</b></font></span></td> <td width="7"><img height="29" src="../images/tu1.gif" width="7" /></td> </tr> </table> <% Rs.PageSize = 4 If Request("PageNo") = "" Then PageNo=1 Else PageNo = CInt(Request("PageNo")) If PageNo < 1 Then Response.Redirect "?PageNo=1" If PageNo > Rs.PageCount And Rs.PageCount > 0 Then Response.Redirect "?PageNo=" & Rs.PageCount If Rs.Eof and Rs.Bof Then PageNo = 0 Else Rs.AbsOlutePage = PageNo For x = 1 to Rs.PageSize If Rs.Eof Then Exit For %> <div class="wang500"> <%do while not rs.eof%> <div><li><% if rs.eof then else if len(rs("title")) > 8 then if (InStr(rs("memo"),"<img")>0) or (InStr(rs("memo"),"<IMG")>0) then %><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><% response.Write left(rs("title"),5)&" ..." %></a> <img src="../images/pic.gif" width="12" height="12"><% else %><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><% response.Write left(rs("title"),5)&" ..."%></a><% end if else if (InStr(rs("memo"),"<img")>0) or (InStr(rs("memo"),"<IMG")>0) then %><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><% response.write rs("title")%></a> <img src="../images/pic.gif" width="12" height="12"><% else %><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><% response.write rs("title")%></a><% end if end if end if %></li></div> <%rs.movenext loop%><table cellspacing="0" width="508" border="0" > <tr><td> </td></tr> <tr> <td align="center"> 总[<span class="style1"> <% = Rs.RecordCount%> </span>]条<strong>|</strong> <span class="style1"> <% = Rs.PageSize%> </span>条<strong>/</strong>页 <strong>|</strong> 当前<span class="style1"> <% = PageNo%> </span><strong>/</strong><span class="style1"> <% = Rs.PageCount%> </span>页 <a href="Untitled-2.asp?PageNo=<% =Rs.AbsOlutePage%>">首页</a> <a href="Untitled-2.asp?PageNo=<% = PageNo - 1%>">上一页</a> <a href="Untitled-2.asp?PageNo=<% = PageNo + 1%>">下一页</a> <a href="Untitled-2.asp?PageNo=<% =Rs.PageCount%>">尾页</a> </td> </tr> </table> </div><% next %> </BODY></HTML>
<div class="wang500"> <%For x = 1 to Rs.PageSize If Rs.Eof Then Exit For %> <div><li><% if not rs.eof then if len(rs("title")) > 8 then if (InStr(rs("memo"),"<img")>0) or (InStr(rs("memo"),"<IMG")>0) then %><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><% response.Write left(rs("title"),5)&" ..." %></a> <img src="../images/pic.gif" width="12" height="12"><% else %><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><% response.Write left(rs("title"),5)&" ..."%></a><% end if else if (InStr(rs("memo"),"<img")>0) or (InStr(rs("memo"),"<IMG")>0) then %><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><% response.write rs("title")%></a> <img src="../images/pic.gif" width="12" height="12"><% else %><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><% response.write rs("title")%></a><% end if end if end if %></li></div> <%rs.movenext next%>注意红色部分!