table paging logic in Javascript
<p>How do i add paging logic to this javascript code (without using jQuery)</p>

<p>var  rowsInTable = response.length;
                    var recsPerPage = prompt("Enter the records per page");</p>

<pre><code>                var noPages; // number of pages in table

                if ((rowsInTable % 2) == 0
                      noPages =  rowsInTable/recsPerPage;
                else 
                      noPages = (rowsInTable/recsPerPage) + 1;

                for (var i = 0; i &lt; rowsInTable; i++)
                {
                    var tr = document.createElement('tr');

                    for (var j = 0; j &lt; rowsInTable[i].length; j++)
                     {
                          var td = document.createElement('td');
                          td.appendchild(document.createTextNode(response[i][j]));
                          tr.appendChild(td);
             }
                }
</code></pre>
