jquery Version v1.8.3是否支持tableSorter?

时间:2018-05-17 05:31:53

标签: javascript jquery

自昨天以来我一直在努力寻找以下解决方案,但没有工作!

  1. http://www.srccodes.com/p/article/27/make-html-table-sortable-jquery-tablesorter-plugin

  2. http://tablesorter.com/docs/

2 个答案:

答案 0 :(得分:0)

它的依赖性说明

依赖

jquery> = 1.2.6

检查https://plugins.jquery.com/tablesorter/

因此,它应该适用于jquery版本1.8.3

广告他们的github说

适用于jQuery 1.2.6+(某些小部件需要jQuery 1.4.1+)。 适用于jQuery 1.9+($ .browser.msie已删除;原始版本需要)。

检查https://github.com/Mottie/tablesorter

答案 1 :(得分:0)

Link the Following files:-

    <!-- choose a theme file -->
<link rel="stylesheet" href="/path/to/theme.default.css">
<!-- load jQuery and tablesorter scripts -->
<script type="text/javascript" src="/path/to/jquery-latest.js"></script>
<script type="text/javascript" src="/path/to/jquery.tablesorter.js"></script>
<!-- tablesorter widgets (optional) -->
<script type="text/javascript" src="/path/to/jquery.tablesorter.widgets.js"></script>
Use THEAD and TBODY in your HTML:-
    <table id="myTable" class="tablesorter">
  <thead>
    <tr>
      <th>Last Name</th>
      <th>First Name</th>
      <th>Email</th>
      <th>Due</th>
      <th>Web Site</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Smith</td>
      <td>John</td>
      <td>jsmith@gmail.com</td>
      <td>$50.00</td>
      <td>http://www.jsmith.com</td>
    </tr>
    <tr>
      <td>Bach</td>
      <td>Frank</td>
      <td>fbach@yahoo.com</td>
      <td>$50.00</td>
      <td>http://www.frank.com</td>
    </tr>
    <tr>
      <td>Doe</td>
      <td>Jason</td>
      <td>jdoe@hotmail.com</td>
      <td>$100.00</td>
      <td>http://www.jdoe.com</td>
    </tr>
    <tr>
      <td>Conway</td>
      <td>Tim</td>
      <td>tconway@earthlink.net</td>
      <td>$50.00</td>
      <td>http://www.timconway.com</td>
    </tr>
  </tbody>
</table>
use javascript function as follow:-
    $(function() {
  $("#myTable").tablesorter();
});
相关问题