title: show more display after some records in php
body: <p>Below is my script working fine for show more and show less. But please tell me how to show first three rows after that. I want to show the show more button.  </p>
  
  <p>The data is coming from <code>foreach</code> loop and in tabular format.<br>
  After x = 4, please tell me what to add so that it displays 3 rows of foreach. After that I want same script to work:   </p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function () {
          x = 4;
  
          size_li = $("#Table td").size();
  
          //$('#Table tr').show(x);
          $('#td td:lt('+x+')').show();
          $('#loadMore').click(function () {
              x= (x+5 &lt;= size_li) ? x+4 : size_li;
              $('#Table td:lt('+x+')').show();
          });
          $('#showLess').click(function () {
              x=(x-5&lt;0) ? 5 : x-4;
              $('#Table td').not(':lt('+x+')').hide();
          });
      });
  &lt;/script&gt;
  </code></pre>