title: Jquery Paging creation without plugin
body: <p>Hi I am leveraging the jquery to create pagination for a demo html table.The idea is not to use any plugin but for sharpening my skills in jquery writing logic to get the job done.</p>
  
  <p>Say following is the html structure:</p>
  
  <pre><code> &lt;div&gt;
      &lt;input type='hidden' id='current_page' /&gt;
      &lt;input type='hidden' id='show_per_page' /&gt;
      &lt;div id='page_navigation'&gt;
      &lt;/div&gt;
      &lt;table id="paginate" id="table1" border="1"&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  1
              &lt;/td&gt;
              &lt;td&gt;
                  2
              &lt;/td&gt;
              &lt;td&gt;
                  3
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  One
              &lt;/td&gt;
              &lt;td&gt;
                  Two
              &lt;/td&gt;
              &lt;td&gt;
                  Three
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  4
              &lt;/td&gt;
              &lt;td&gt;
                  5
              &lt;/td&gt;
              &lt;td&gt;
                  6
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  7
              &lt;/td&gt;
              &lt;td&gt;
                  8
              &lt;/td&gt;
              &lt;td&gt;
                  9
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  40
              &lt;/td&gt;
              &lt;td&gt;
                  50
              &lt;/td&gt;
              &lt;td&gt;
                  60
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  4000
              &lt;/td&gt;
              &lt;td&gt;
                  5000
              &lt;/td&gt;
              &lt;td&gt;
                  6000
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  42
              &lt;/td&gt;
              &lt;td&gt;
                  52
              &lt;/td&gt;
              &lt;td&gt;
                  62
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Pls note I have taken two hidden var for current page and per page item count.Now the jquery I hvae so far written.</p>
  
  <pre><code> $(document).ready(function () {
  
  
                      debugger;
                      var show_per_page = 3;
                      var number_of_items = $('#paginate tr').size();
                      var number_of_pages = Math.ceil(number_of_items / show_per_page);
                      $('#current_page').val(1);
                      $('#show_per_page').val(show_per_page);
                      var navigation_html = '&lt;a class="previous_link" href="javascript:callPrev();"&gt;Prev&lt;/a&gt;' + '&amp;nbsp';
                      var current_link = 1;
                      while (number_of_pages &gt; current_link) {
                          navigation_html += '&lt;a class=page_link" href="javacsript:showPage(' + current_link + ')" longdesc="' + current_link + '"&gt;' + (current_link + 1) + '&lt;/a&gt;' + '&amp;nbsp';
                          current_link++;
                      }
                      navigation_html += '&lt;a class="next_link" href="javascript:next();"&gt;Next&lt;/a&gt;';
                      $('#page_navigation').html(navigation_html);
                      $('#paginate tr').css('display', 'none');
                      for (var i = 0; i &lt; show_per_page; i++) {
                          $('#paginate tr').eq(i).css('display', 'block');
                      }
  
  
      });
  </code></pre>
  
  <p>It is working and created the paging bar.But now I am somehow lost how I will handle next() and callPrev() these two functions as I have to write definition for it.</p>
  
  <p>Please bear with me as I am learning jquery.
  Thanks.</p>