# 用迴圈做課程表輸出表格

<table border="1" cellspacing="0" bordercolor="#006699">

<%
hang=41 '行變數
lie=9 '列變數
leirong=blie&" "&bhang
for bhang=1 to hang
response.write("<tr>")
'------------------------------------------------控制星期開始
for blie=1 to lie
if bhang=1 then
if blie=1 then
response.Write("<td colspan=2 width=108>第"&weektime&"周")
else
if not blie=9 then
response.Write("<th width=93>")
xqnotemp=blie-1
if xqnotemp=1 then xqno="一"
if xqnotemp=2 then xqno="二"
if xqnotemp=3 then xqno="三"
if xqnotemp=4 then xqno="四"
if xqnotemp=5 then xqno="五"
if xqnotemp=6 then xqno="六"
if xqnotemp=7 then xqno="日"
response.Write("星期"&xqno)
response.write("</th>")
end if
end if
else
if ((bhang+2) mod 4)=0 and blie=1 then
response.Write("<td rowspan=4>"&(bhang+2)/4&"小節")
response.Write(" ")
response.write("<td>")
response.write("實驗名稱")
response.write("</td>")
else
if not blie=9 then
'------------------------------控制實驗名稱、班級、任課教師內容開始
if (not blie=1) and ((bhang+2) mod 4=0) then
response.write("<td rowspan=4>")
response.write("<table><tr>")
rs.open "select * from lesson",conn,1,1
' response.write(rs("day"))
rs.close
response.write("<td></td></tr></table>")
response.write(blie-1&" "&bhang)
response.write("</td>")
else
'------------------------------顯示第二實驗名稱、班級、任課教師開始
if blie=1 then
response.Write("<td width=63 algin="&"center"&">")
if bhang mod 3=0 then
response.write("<span style=line-height:2; line-width: 20; vertical-align: top> <font style=font-size:9pt> 班級</font></span>")
elseif bhang mod 4=0 then
response.write("任課教師")
else
response.write("人數")
end if
response.Write("</td>")
end if
'------------------------------顯示第二實驗名稱、班級、任課教師結束
end if
'------------------------------控制實驗名稱、班級、任課教師內容結束
end if
end if
end if

next
'---------------------------------------------------控制星期結束
response.write("</tr>")
next

%>
</table>

## E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

## Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

## Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth \$300-1200 USD