I would like to break my record set display after every three(3) records. With MAx of (9) records, which is set, Currently it continues to layout in row, does not make a new line after three records. HELP, PLEASE <% 'DIM iRecordCount iRecordCount = 0 DO WHILE NOT objRS.EOF and iRecordCount <> 9 %> <td class="" style="background-image: url(<% =objRS("Thumbnail") %>); background-repeat:repeat; width: 275px; height: 138px;" > <div class="FieldDiv"> <%if RelatedURL = "" then%> <a href="register.asp?Action=Signup" alt="<% =objRS("ContentTitle") %>" class="FieldFont"> SIGN-UP HERE!</a> <%else%> <a href="<% =objRS("RelatedURL") %>" alt="<% =objRS("ContentTitle") %>" class="FieldFont"> SIGN-UP HERE!</a> <%end if%> </div> </td> <% iRecordCount = iRecordCount + 1 objRS.MoveNext Loop objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing %> </tr> </table> Code (markup):
I tried adding this in and get an a error, can some one tell me where should this piece of <tr> break code go before the loop: <% If (iRecordCount Mod 3) = 0 Then If iRecordCount>0 Then Response.Write("</tr>") Response.Write("<tr>") End If %> <% iRecordCount = iRecordCount + 1 objRS.MoveNext Loop objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing %> Code (markup):
If (iRecordCount Mod 3) = 0 Then If iRecordCount>0 Then Response.Write("</tr>") Response.Write("<tr>") how about checking for iRecordCount = 3 and then setting iRecordCount = 0 if true