我有一段代码,可以从网页上的数据库ACROSS 3列按字母顺序写入数据.
例:
a result b result c result d result e result f result g result h result i result
我需要在字母表中向下显示列,如下所示:
a result d result g result b result e result h result c result f result i result
请记住,我有大约100个数据结果,它将显示第一列中的前1/3,然后开始一个新列并继续,将其分成3个相等的部分.
我现在对行进行排序的代码是:
<%
GL="<table width="+Z+"100%"+Z+"border=0 cellpadding=3 celspacing=3>"
sql="select * from guideDef order by guideDesc;"
rs.open sql,adoCon
colCount=0
do while not rs.eof
colCount=(colCount+1) mod 3
if colCount=1 then GL=GL+"<tr>"
GL=GL+"<td valign=middle id=menu1 width="+Z+"33%"+Z+">"+E
GL=GL+"<a href="+Z+"shop.asp?guide="+rs("guide")+"&city=Plantation"+Z+">"+E
GL=GL+rs("guideDesc")+"</a></td>"
if colCount=0 then GL=GL+"</tr>"
GL=GL+E
rs.moveNext
loop
rs.close
if colCount=1 then GL=GL+"<td> </td><td> </td></tr>"+E
if colCount=2 then GL=GL+"<td> </td></tr>"+E
GL=GL+"</table>"
response.write GL
%>
Run Code Online (Sandbox Code Playgroud)
在此先感谢您的帮助.我不写代码,所以我已经尝试了几个小时来改变这个但没有成功.
| 归档时间: |
|
| 查看次数: |
1763 次 |
| 最近记录: |