......
<table>
<%
iCo=3 '每行3个
i=0
do until rs.eof
i=i+1
if (i mod iCo)=1 then response.write "<tr>" '在1 4 7处均换行
response.write "<td>" & rs("doc") & "</td>"
if (i mod iCo)=0 then response.write "</tr>" '在 3 6 9处准备另起一行
loop
for m=iCo-1 to (i mod iCo) step -1 '如果最后一行不到三列,补足空列
response.write "<td> </td>"
next
if (i mod iCo)<>0 then response.write "</tr>" '补空列,也要补行结束符
'这里的补空列及最后补结束符即使不要也不会运行出错,因为HTML容错
%>
</table>
...........