Making a <BR> after third record?

Discussion in 'Programming' started by danjapro, Feb 26, 2009.

  1. #1
    I want to know how to add a <BR> or new line after a third record or after each 3 records. Its a Select statment that works, but the records keep building across and messing with my page width:

    <table style="width:100%;">
    <tr valign=top>
    <td >
    						<!-- photo -->
    <a href="member/user_profile.asp?user_id=<%=user_id%>">
    						<img src="files/photo/<%=photo%>" border=0 style="width:100px; height::100px;">
    </a>
    </td>
    </tr>
    <tr>
    <td>
    						<!-- info -->
    						<font class=profile><b><%=username%> - <%=religion%></b></font><br>
    					<font class=profile><%=gender%> - <%=gender_look%></font><br>
    					<font class=profile><a href="member/user_profile.asp?user_id=<%=user_id%>" class="profile"><img src="/images/app/tabs_profile_listen.gif" border="0"></a></font><br>
    <font class=profile><a href="<%=ethnicity%> " class="profile"><img src="/images/app/tabs_profile_buy.gif" border="0"></a></font><br>
                    						<font class=profile><a href="member/user_profile.asp?user_id=<%=user_id%>#ringtone" class="profile"><img src="/images/app/tabs_profile_ringtone.gif" border="0"></a></font>
    <br><font class=profile><%=located%></font><br>
    </td>
    </tr>
    </table>
    							<%
    	rs.movenext
    	wend
    	rs.close
    	set rs = nothing
    	%>
    Code (markup):
     
    danjapro, Feb 26, 2009 IP
  2. jimbo2779

    jimbo2779 Active Member

    Messages:
    105
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    80
    #2
    if you are using PHP you could do something like below:
    
    $count = 0;
    while(true){
      $count++;
    
      echo "YOUR OUTPUT";
    
      if ($count==3){
        echo "<BR>";
        $count = 0;
      }
    }
    
    Code (markup):
    I know its pretty basic and very general but if you know a bit of code and are using PHP Im sure you could use this.
     
    jimbo2779, Feb 26, 2009 IP