title: jQuery Datatable with Struts 2
body: <p>I am using jQuery Datatable to display a table from database and iterating using <code>&lt;s:iterator&gt;</code>.</p>
  <pre class="lang-jsp prettyprint-override"><code> &lt;html&gt;
   &lt;head&gt;   
      &lt;link href=&quot;css/forum.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt; 
              &lt;link href=&quot;css/media/dataTables/demo_page.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
              &lt;link href=&quot;css/media/dataTables/demo_table.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
              &lt;link href=&quot;css/media/dataTables/demo_table_jui.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
              &lt;link href=&quot;css/media/themes/base/jquery-ui.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;all&quot; /&gt;
              &lt;link href=&quot;css/media/themes/smoothness/jquery-ui-1.7.2.custom.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;all&quot; /&gt;
              &lt;script src=&quot;js/jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
              &lt;script src=&quot;js/jquery.dataTables.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
          $(document).ready(function () {
              $(&quot;#display&quot;).dataTable({
                  &quot;bJQueryUI&quot;: true,
                  &quot;iDisplayLength&quot;: 5,
                  &quot;sPaginationType&quot;: &quot;full_numbers&quot;,
              });
          });
          &lt;/script&gt;
     
   &lt;/head&gt;
  &lt;body&gt;
  &lt;table id=&quot;display&quot;&gt;
           &lt;thead&gt;
               &lt;tr&gt;&lt;th&gt;Title&lt;/th&gt;&lt;/tr&gt;
               &lt;tr&gt;&lt;th&gt;Desc&lt;/th&gt;&lt;/tr&gt;
           &lt;/thead&gt;
           &lt;tbody&gt;
             &lt;s:iterator  value=&quot;travelBean&quot;  status=&quot;i&quot;&gt;
             &lt;tr&gt;
              &lt;td&gt;
                 &lt;s:url action=&quot;Display&quot; var=&quot;DisplayLink&quot;&gt;
                    &lt;s:param name=&quot;title&quot;&gt;&lt;s:property value=&quot;title&quot;/&gt;&lt;/s:param&gt;
                  &lt;/s:url&gt;
                &lt;a href=&quot;${DisplayLink}&quot;&gt;
               &lt;s:property value=&quot;Desc&quot;/&gt;&lt;/a&gt;
           &lt;/td&gt;
          &lt;/tr&gt;
         &lt;/s:iterator&gt;
         &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;html&gt;
  
          
  </code></pre>
  <p>In the output <code>&lt;div&gt;</code> which will form above the table from query to show entries and below for first, previous and next button are not appearing if I put <code>&lt;tr&gt;</code> <code>&lt;td&gt;</code> inside <code>&lt;s:iterator&gt;</code> and if I remove <code>&lt;tr&gt;</code> <code>&lt;td&gt;</code> then the <code>&lt;div&gt;</code>s are appearing but no table entries available in the table. Am not sure what will be the issue?</p>