title: Giving simple js pagination to a Ajax generated table
body: <p>I have a ajax call in drupal which generates and brings back a entire table right under where I click. The tables are large, so I want them paginated. I don't have time for server side pagination and I also need to apply it in a lot of places.</p>
  
  <p>I found this <a href="http://code.google.com/p/one-simple-table-paging/" rel="nofollow noreferrer">http://code.google.com/p/one-simple-table-paging/</a> a very easy to use one and should solve my purpose.</p>
  
  <p>I managed to use it in static html pages: </p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-1.8.2.js"&gt;&lt;/script&gt;
  &lt;script src="oneSimpleTablePaging-1.0.js"&gt;&lt;/script&gt;
  
  &lt;table class="tableToPaginate"&gt;
      &lt;tr&gt;
          &lt;th&gt;Id&lt;/th&gt;&lt;th&gt;Name&lt;/th&gt;
      &lt;/tr&gt;
          &lt;?php for ($i = 0; $i &lt; 100; $i++) { ?&gt;                            
          &lt;tr&gt;
              &lt;td&gt;&lt;?php echo $i ?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo "name" . $i ?&gt;&lt;/td&gt;
          &lt;/tr&gt;                        
          &lt;?php } ?&gt;
  &lt;/table&gt;
  
  &lt;script&gt;
     $(document).ready(function(){
         $('.tableToPaginate').oneSimpleTablePagination({rowsPerPage: 20});
     });        
  &lt;/script&gt;
  </code></pre>
  
  <p>but when I use the same technique for my ajax generated tables giving them the same class and calling the script in page.tpl, php I don't see the pagination</p>
  
  <pre><code>echo '&lt;table id="ajaxcustomerdata" class="account_info tableToPaginate"&gt;';
  .....
  </code></pre>
  
  <p>I am new with ajax and js; please help me out.</p>