核糖体和rna的关系:asp动态数据排列的问题

来源:百度文库 编辑:神马品牌网 时间:2024/05/03 08:55:21
sub SearchResultContent()
dim i,strTemp,content
i=1
do while not rsSearch.eof
strTemp=""
strTemp= strTemp & "<table width=25% border=1 cellspacing=3 cellpadding=0 bordercolor=#3399FF>"
strTemp= strTemp & "<tr><td>"
strTemp= strTemp & "<div align=center><a href=ProductShow.asp?ArticleID=" & rsSearch("articleid") & ">"

fileExt=lcase(getFileExtName(rsSearch("DefaultPicUrls")))
if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
strTemp= strTemp & "<img border=0 src=" & rsSearch("DefaultPicUrls") & " width=150 height=150>"
else
if fileext="swf" then
strTemp= strTemp & "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='105' height='84'>"
strTemp= strTemp &"<param name=movie value='"&rsSearch("DefaultPicUrls")&"'>"
strTemp= strTemp &"<param name=quality value=high>"
strTemp= strTemp &"<param name='Play' value='-1'>"
strTemp= strTemp &"<param name='Loop' value='0'>"
strTemp= strTemp &"<param name='Menu' value='-1'>"
strTemp= strTemp &"<param name='wmode' value='transparent'>"
strTemp= strTemp &"<embed src='"&rsSearch("DefaultPicUrls")&"' width='105' height='84' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed> </object>"

end if
end if

strTemp= strTemp & "</a></div></td></tr>"
strTemp= strTemp & "<tr><td>"
strTemp= strTemp & "<div align=center><a href='ProductShow.asp?ArticleID=" & rsSearch("articleid") & "' target='_blank'>" & rsSearch("Title") & ""
strTemp= strTemp & "</a></div></td></tr>"

strTemp= strTemp & "<tr><td>"
strTemp= strTemp & "<div align=center><a href='ProductShow.asp?ArticleID=" & rsSearch("articleid") & "' target='_blank'>" & rsSearch("Spec") & ""
strTemp= strTemp & "</a></div></td></tr>"
strTemp= strTemp & "</table>"

response.write strTemp
rsSearch.movenext

i=i+1
if i>=MaxPerPage then exit do
loop
end sub
===============================================================
这个源码只显示为
A
B
C
D
E
……
======
怎么改成显示为:
A B C
D E F
……
怎么没有好答案,谁能在我提供的源码上直接修改??不要再给范例我看,我笨,看不懂,再加50分!希望有人给我最佳答案,采纳再给100分

感谢2楼的,但是试了还是不行,还是一直往下排,而且排列不整齐了

修改处:
sub SearchResultContent()
dim i,strTemp,content
i=0
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<table width=100 height=199 border=0 cellpadding=0 cellspacing=0>"

do while not rsSearch.eof

strTemp=""
strTemp= strTemp & "<td><table width=25% border=1 cellspacing=3 cellpadding=0 bordercolor=#3399FF>"
'strTemp= strTemp & "<tr>"
strTemp= strTemp & "<tr><td>"
strTemp= strTemp & "<div align=center><a …………

…………
strTemp= strTemp & "<div align=center><a href='ProductShow.asp?ArticleID=" & rsSearch("articleid") & "' target='_blank'>" & rsSearch("Spec") & ""
strTemp= strTemp & "</a></div></td></tr>"

strTemp= strTemp & "</table></td>"

if i mod 4<>0 then
end if
if i mod 4=3 then
strTemp= strTemp & "</tr>"
strTemp= strTemp & "<tr>"
end if

response.write strTemp
rsSearch.movenext
i=i+1
if i>=MaxPerPage then exit do
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
loop
end sub

注意修改过的地方,还有要注意你'ProductShow.asp文件的TABLE,TABLE不对有冲突,自己调整几次就可以,不会加我QQ2221527

这是一段vbscript
把他看明白了就能做出来//
//if (i mod 3=0) then 中的3表示一行3个..

<script language="vbscript">
dim n,i
document.write("<table width='300px' border='1'>")
document.write("<tr>")
for n=1 to 50
document.write("<td width='50pt'>"&n&"</td>")
i=i+1
if (i mod 3=0) then
document.write("</tr></tr>")
end if
next
document.write("<tr>")
document.write("<table>")
</script>

把<table>和<tr>指定都放在循环外面,在循环里放<td>,条件合适的时候放</tr></tr>,在循环终了后补足<td>。具体示例代码如下:

<table>
<tr>
<%
i=1
j=1
do while not rs.eof()
j=j+1
i=i+1
if i>=MaxPerPage then exit do
if j=3 then response.write("</tr><tr>")
loop

if j<3 then
for i=j to 3
response.write("<td></td>")
next
response.write("</tr>")
end if
%>
</tr>
</table>

帮你改了如下:

<%
sub SearchResultContent()
dim i,strTemp,content
i=1
j=1
response.write("<table width=25% border=1 cellspacing=3 cellpadding=0 bordercolor=#3399FF>")
response.write("<tr><td>")
do while not rsSearch.eof
i=i+1
j=j+1
strTemp=""
strTemp= strTemp & "<div align=center><a href=ProductShow.asp?ArticleID=" & rsSearch("articleid") & ">"
fileExt=lcase(getFileExtName(rsSearch("DefaultPicUrls")))
if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
strTemp= strTemp & "<img border=0 src=" & rsSearch("DefaultPicUrls") & " width=150 height=150>"
else
if fileext="swf" then
strTemp= strTemp & "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='105' height='84'>"
strTemp= strTemp &"<param name=movie value='"&rsSearch("DefaultPicUrls")&"'>"
strTemp= strTemp &"<param name=quality value=high>"
strTemp= strTemp &"<param name='Play' value='-1'>"
strTemp= strTemp &"<param name='Loop' value='0'>"
strTemp= strTemp &"<param name='Menu' value='-1'>"
strTemp= strTemp &"<param name='wmode' value='transparent'>"
strTemp= strTemp &"<embed src='"&rsSearch("DefaultPicUrls")&"' width='105' height='84' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed> </object>"
end if
end if

strTemp= strTemp & "</a></div></td></tr>"
strTemp= strTemp & "<tr><td>"
strTemp= strTemp & "<div align=center><a href='ProductShow.asp?ArticleID=" & rsSearch("articleid") & "' target='_blank'>" & rsSearch("Title") & ""
strTemp= strTemp & "</a></div></td></tr>"

strTemp= strTemp & "<tr><td>"
strTemp= strTemp & "<div align=center><a href='ProductShow.asp?ArticleID=" & rsSearch("articleid") & "' target='_blank'>" & rsSearch("Spec") & ""
strTemp= strTemp & "</a></div>"

response.write strTemp
rsSearch.movenext

if i>=MaxPerPage then exit do
if j=3 then response.write("</tr><tr>")
loop
if j<3 then
for i=j to 3
response.write("<td></td>")
next
response.write("</tr>")
end if
response.write("</td></tr>")
response.write("</table>")

end sub
%>