title: data table is not working on my table in view page in mvc
body: <p>i want to make table as datatable but its not applying in my table. datatable is working in static table but while im adding dynamic table its not showing any datatable features like search option and paging. all the records showing at time even though its selected 10 in the paging .</p>
  
  <p>code</p>
  
  <pre><code>   &lt;script&gt;
              $(document).ready(function () {
                  $('#example').DataTable();
              });
          &lt;/script&gt;
  
  
      &lt;table id="example" class="display" width="100%" cellspacing="0"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;deviceid&lt;/th&gt;
              &lt;th&gt;status&lt;/th&gt;
              &lt;th&gt;UpdatedTime&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tfoot&gt;
          &lt;tr&gt;
              &lt;th&gt;deviceid&lt;/th&gt;
              &lt;th&gt;status&lt;/th&gt;
              &lt;th&gt;UpdatedTime&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/tfoot&gt;
  
  @foreach (var item in Model)
  {
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.deviceid)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.status)&lt;/td&gt;
              &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.UpdatedTime)&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  }
  &lt;/table&gt;
  </code></pre>