nutan12 0 Newbie Poster

im trying to display 10 rows in a table. it workd fine upto displaying 10 records but im not sure how to add logic to go to next page to view next 10 records.
below is my code;

<p><h1 class="TextHeading1" align="center">Search<a name=<%=outerKey%>><%=outerKey%></a>Result:</h1></p>
            <table class="TableBackgroundDB">
<%
            int limit = 10;
            int start = 0; 
            int count = 0;
      
            List<Map> elementList = mapResult.get(outerKey);
            List<String> headerList = null;
            if(elementList.size() < limit) 
                  limit = elementList.size();
                  for(int i=start; i< limit; i++){
                  //for(int i=0; i<elementList.size(); i++){
                      String style="TableRowOdd";
                      if(i%2==0){
                              style="TableRowEven";
                        }  
                      
                        count++;
          
            //some code to add header here 
%>
                              <tr class="TableHeaderRow">
<%
                              for(int j=0; j<headerList.size(); j++){
                                  header = headerList.get(j);
%>
                                    <th><%=header%></th>
<%                                
                              }
%>
                              </tr>
<%
                      }
%>
                           <tr class="<%=style%>">
<%
                        //some code to add values to table
%>
                                    <td><%=value%></td>
<%
                            }
%>
<%
if((count%limit) == 0) {
%>
                        </tr>
            </table>
<%
      count = 0;
            }
      }
%>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.