Web ページのACROSS 3 列のデータベースからアルファベット順にデータを書き込むコードのスニペットがあります。
例:
a 結果 b 結果 c 結果 d 結果 e 結果 f 結果 g 結果 h 結果 i 結果
代わりに、次のように列をアルファベット順に表示する必要があります。
a 結果 d 結果 g 結果 b 結果 e 結果 h 結果 c 結果 f 結果 i 結果
約 100 のデータ結果があることを念頭に置いて、最初の 1/3 を 1 列目に降順で表示し、次に新しい列を開始して続行し、それを 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
%>
助けてくれてありがとう。私はコードを書かないので、何時間もこれを変更しようとしましたが、成功しませんでした。