<table width="996" border="0" align="center" height="20" cellpadding="1" cellspacing="1" bordercolor="#CCCCCC" bgcolor="#CCCCCC">
<tr width="996" height="20" colspan=8>
<td colspan=8 bgcolor="#EFEFEF"> 当前位置:</a>最新奇迹私服技术文章>><a href="index.asp">返回首页</a></td>
</tr>
<%
sql="select * from News order by addtime desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td colspan=8 align=center>当前没有公告!</td></tr>"
rs.close
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end ifif (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"news.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
showContent
showpage totalput,MaxPerPage,"news.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"news.asp"
end if
end if
rs.close
end if
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
<tr height="1" bgcolor=#FFFFFF>
<td colspan=1> <a href="news_display.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
rs.close
end sub
%>
</table>以上是一个文章页面代码 显示出来的只有一列如图要怎么改才能让(如图)右边也显示文章,而且是不重复的文章
<tr width="996" height="20" colspan=8>
<td colspan=8 bgcolor="#EFEFEF"> 当前位置:</a>最新奇迹私服技术文章>><a href="index.asp">返回首页</a></td>
</tr>
<%
sql="select * from News order by addtime desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td colspan=8 align=center>当前没有公告!</td></tr>"
rs.close
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end ifif (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"news.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
showContent
showpage totalput,MaxPerPage,"news.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"news.asp"
end if
end if
rs.close
end if
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
<tr height="1" bgcolor=#FFFFFF>
<td colspan=1> <a href="news_display.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
rs.close
end sub
%>
</table>以上是一个文章页面代码 显示出来的只有一列如图要怎么改才能让(如图)右边也显示文章,而且是不重复的文章
dim i
i=0
%>
<%do while not rs.eof%>
<tr height="1" bgcolor=#FFFFFF>
<td colspan=1> <a href="news_display.asp?id= <%=rs("id")%>" target="_blank"> <%=rs("title")%> </a> </td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
<%if (i mod 0)=0 then%>
<tr height="1" bgcolor=#FFFFFF>
<%end if%>
<td colspan=1> <a href="news_display.asp?id= <%=rs("id")%>" target="_blank"> <%=rs("title")%> </a> </td>
<%if (i mod 0)=0 then%>
</tr>
<%end if%>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
rs.close
end sub
这个我知道在那里面填充,可是我不知道该怎么在TD中用一定算法填充RS,,
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
<%if (i mod 2)=0 then%>
<tr height="1" bgcolor=#FFFFFF>
<%end if%>
<td colspan=1> <a href="news_display.asp?id= <%=rs("id")%>" target="_blank"> <%=rs("title")%> </a> </td>
<%if (i mod 2)=0 then%>
</tr>
<%end if%>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
rs.close
end sub