loops - count up + 1 in looping data in table -
i have loop gives me data in form of table, haven't figured out how loop + 1 there number on left side of each row of data in order, 1, 2, 3, 4. using mssql data , table works great in regards that. want numbers @ beginning of each row.
here current code:
<% if delivery_id<>"" each x in rs.fields response.write"<th><b>" & (ucase(x.name) & "</b></th>") next%> </tr> <%do until rs.eof%> <tr> <%for each x in rs.fields %> <td> <% response.write(x.value)%></td> <%next rs.movenext%> </tr> <%loop rs.close conn.close end if %> </table></font>
can assist me?
start setting intc int.
dim intc
assign start value.
intc = 0
place value inside each statement.
adding 1 within for each loop statement.
intc = intc + 1
place results before response.write in
if need add space use
between
<%=intc%>.
<%response.write.....
below sample code field count code in place. note: if need reset counter when start processing do until 0 counter out above <%loop adding intc = 0
<% dim intc intc = 0 if delivery_id<>"" each x in rs.fields response.write"<th><b>" & (ucase(x.name) & "</b></th>") next%> </tr> <%do until rs.eof%> <tr> <%for each x in rs.fields intc = intc + 1 %> <td><%=intc%>. <% response.write(x.value)%></td> <%next rs.movenext%> </tr> <%loop rs.close conn.close end if %> </table></font>
Comments
Post a Comment