在DW中产生多项重复记录时候。一般只能纵向向下排列。如何能让它比如横向5条超过5条再纵向向下排
插入记录先,选择表格的<TR>(如果为多项重复记录在这个外面再嵌套一个表格)将重复记录的这段代码放在<tr>里面 <%
While ((Repeat1__numRows <> 0) AND (NOT linkpost.EOF))
%>
.
.
.
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
linkpost.MoveNext()
Wend
%>
</tr>
然后再定义这个表格(嵌套在外面的表格)中的<td id>
<td id="<% dim temp
tamp=tamp+1
Response.Write(temp) %>">
然后再</td>表格结束加入代码
<% If temp mod 5=0 Then Response.Write("</tr><tr>") %>其中的5表示横向5条记录
整个表格代码如下
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT linkpost.EOF))
%>
<td id="<% dim temp
tamp=temp+1
Response.Write(temp) %>"><table width="90" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td align="center"><a href="picview.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "pid=" & linkpost.Fields.Item("pid").Value %>" target="_self"><img src="post/<%=(linkpost.Fields.Item("pimgs").Value)%>.GIF" border="0"></a></td>
</tr>
<tr>
<td height="15" align="center" valign="middle" class="bai"><a href="picview.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "pid=" & linkpost.Fields.Item("pid").Value %>" target="_self"><%=(linkpost.Fields.Item("ptit").Value)%></a></td>
</tr>
</table></td>
<% If temp mod 5=0 Then Response.Write("</tr><tr>") %>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
linkpost.MoveNext()
Wend
%>
</tr>
</table>