title: Display dynamic columns data with next and prev buttons in jsp
body: <p>I'm displaying my table values using arraylists with jstl tags on jsp pages.
  Here's the code:</p>
  
  <pre><code>&lt;table class="box-table" summary="Shift details"&gt;
              &lt;!-- column headers --&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;c:forEach var="columnName" items="${columnHeader}"&gt;
                          &lt;th scope="col"&gt;&lt;c:out value="${columnName}" /&gt;&lt;/th&gt;
                      &lt;/c:forEach&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;!-- column data --&gt;
              &lt;tbody&gt;
  
                  &lt;c:forEach var="row" varStatus="altrow" items="${tableData}"&gt;
                      &lt;tr class="${altrow.index % 2 == 0 ? 'even' : 'odd'}"&gt;
                          &lt;c:forEach var="column" items="${row}"&gt;
                              &lt;td&gt;&lt;c:out value="${column}" /&gt;&lt;/td&gt;
                          &lt;/c:forEach&gt;
                      &lt;/tr&gt;
                  &lt;/c:forEach&gt;
              &lt;/tbody&gt;
          &lt;/table&gt;
  </code></pre>
  
  <p>In the code, columnHeader is arraylist for column data and tableData is arraylist for rows data. Everything is good till now.. but rows are static (each row indicates a user's data for that date) and column data(dates) is dynamic. So I want to display something like this..</p>
  
  <p><img src="https://i.stack.imgur.com/L0TAG.png" alt="Displays data for 10 only"></p>
  
  <p>Suppose I have an arraylist of 30 dates but I need to display only 10 dates and remaining 10 on click of next button and so on, navigate back when prev button pressed.</p>
  
  <p>Please point me in the right direction to achieve this...</p>