日期:2014-05-17 浏览次数:20724 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>幻灯片</title> <style type="text/css"> *{ font-family:verdana; font-size:12px;} </style> </script> </head> <body> <script language="javascript" type="text/javascript"> function show(){ var i=0,j=0,vn=0,vo=0; var mn=100, lines=3, dn=3; var strTXT=''; var celMaxNum=Math.floor(mn/lines); for(j=1;j<=lines;j++){ vn=0; vo=0; if(j<10) strTXT+= '<br>0'+j+'--'; else strTXT+= '<br>'+j+'--'; for(i=0;i<celMaxNum-1;i++){ if(i==0 && (j==1 || j==2 || j==3)) vn=vo+j+dn; else vn=vo+j+dn-j; vo=vn; if(vn<10) strTXT+= '0'+vn+'--'; else strTXT+=vn+ '--'; } } document.write(strTXT); } </script> <a href="javascript:show();">show number</a> </body> </html> <br> 比如数据 1-------99页面自动显示为<br> 1 4 7<br> 2 5 8<br> 3 6 9<br> 每够三行就换列显示
------解决方案--------------------
<%
Dim Count,Columns
Count = 99
If Count Mod 3 = 0 Then
Columns = Count / 3
Else
Columns = Int(Count / 3) + 1
End If
If Count < 3 Then
For i = 1 To Count
Response.Write i & "<br>"
Next
Else
For i = 1 To 3
For j = 1 To Columns
If (j-1) * 3 + i > Count Then Exit For
Response.Write (j-1) * 3 + i & " "
Next
Response.Write "<br/>"
Next
End If
%>