ClassicASP Split로 2차원배열 출력하기
페이지 정보
본문
[ view.asp : 2차원 배열을 페이지에 출력하기 ]
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<col width="60">
<col width="150">
<col width="150">
<col >
<tr>
<td height="25"></td>
<td style='padding:0 10px 0 10px;'>이름</td>
<td style='padding:0 10px 0 10px;'>연락처</td>
<td style='padding:0 10px 0 10px;'>E-mail</td>
</tr>
<tr><td colspan="4" height="1" bgcolor="#e7e7e7"></td></tr>
<%
Dim Arry1, Arry2, Arry3, Arry4, k1, k2
Arry1 = rs("tkb_buyer")
'Arry1 = "2006|10|18,2006|10|19,2006|10|20,2006|10|21,2006|10|22,2006|10|23,2006|10|24,"
Arry2 = Split(Arry1,",") '요놈이 배열선언
Arry3 = UBound(Arry2)
redim Arry4(Arry3) ' 배열 사이즈 재정의
For k1 = 0 To eval(Arry3-1) 'for문을 돌리면서
response.write "<tr>"
'response.write Arry2(k1) & "<tr>"
Arry4(k1)=Split(Arry2(k1),"|")
'response.write uBound(Arry4(k1)) & "</tr>"
Response.write "<td style='padding-left:20px; height:30px;'>"& k1 +1 &"</td>"
For k2 = 0 To 2
response.write "<td style='padding:0 10px 0 10px;'>" & Arry4(k1)(k2) & "</td>"
Next
response.write "</tr>"
If k1 <> eval(Arry3-1) then
response.write "<tr><td colspan='4' height='1' bgcolor='#e7e7e7'></td></tr>"
End if
Next
%>
</table>
관련자료
http://blog.naver.com/angddu/10023491561
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<col width="60">
<col width="150">
<col width="150">
<col >
<tr>
<td height="25"></td>
<td style='padding:0 10px 0 10px;'>이름</td>
<td style='padding:0 10px 0 10px;'>연락처</td>
<td style='padding:0 10px 0 10px;'>E-mail</td>
</tr>
<tr><td colspan="4" height="1" bgcolor="#e7e7e7"></td></tr>
<%
Dim Arry1, Arry2, Arry3, Arry4, k1, k2
Arry1 = rs("tkb_buyer")
'Arry1 = "2006|10|18,2006|10|19,2006|10|20,2006|10|21,2006|10|22,2006|10|23,2006|10|24,"
Arry2 = Split(Arry1,",") '요놈이 배열선언
Arry3 = UBound(Arry2)
redim Arry4(Arry3) ' 배열 사이즈 재정의
For k1 = 0 To eval(Arry3-1) 'for문을 돌리면서
response.write "<tr>"
'response.write Arry2(k1) & "<tr>"
Arry4(k1)=Split(Arry2(k1),"|")
'response.write uBound(Arry4(k1)) & "</tr>"
Response.write "<td style='padding-left:20px; height:30px;'>"& k1 +1 &"</td>"
For k2 = 0 To 2
response.write "<td style='padding:0 10px 0 10px;'>" & Arry4(k1)(k2) & "</td>"
Next
response.write "</tr>"
If k1 <> eval(Arry3-1) then
response.write "<tr><td colspan='4' height='1' bgcolor='#e7e7e7'></td></tr>"
End if
Next
%>
</table>
관련자료
http://blog.naver.com/angddu/10023491561
댓글목록
등록된 댓글이 없습니다.