'显示小类别
Sub ShowProClass()
'ProClass 小类返回的数组
'MaxC '商品个数
'TdC '每行显示个数
const TdC = 5
dim j ,MaxC
j=0
if not isarray(ProClass) then
Response.Write "此系列无类别"
else
MaxC = UBound(ProClass,2)
%>
<table width="565" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<%for m =0 to myint((MaxC+1)/TdC)-1%>
<tr bgcolor="e6e6e6" height="26" class="unnamed2">
<%for k = 0 to 4%>
<td height="26" width="113">
<div align="center">
<%
if j > MaxC then '没有商品了
Response.Write " "
else
Response.Write ProClass(1,j)
end if
%>
</div>
</td>
<%
j = j+1
next'td循环
%>
</tr>
<%next%>
</table>
<%
end if
End Sub
博客展示了一段VBA代码用于显示小类别。代码中定义了每行显示个数等常量和变量,通过循环判断商品个数,使用表格和单元格布局,若有商品则显示对应类别,无商品则显示空格,最终实现小类别的展示。





