表分类器不起作用

电子警察

我正在尝试使用表排序器对表进行排序,但是它不起作用

<html>
<head>
     <link rel="stylesheet" href="blueStyle.css" type="text/css" media="print, projection, screen" />
    <script src="http://tablesorter.com/jquery-latest.js" type="text/javascript"></script> 
    <script src="http://tablesorter.com/__jquery.tablesorter.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(document).ready(function() {      
        $("#myTable").tablesorter();
    }); 
    </script>
</head>
<body>
<table id="myTable" class="tablesorter" border="0" cellpadding="0" cellspacing="1"> 
<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>[email protected]</td> 
    <td>$50.00</td> 
    <td>http://www.jsmith.com</td> 
</tr> 
<tr> 
    <td>Bach</td> 
    <td>Frank</td> 
    <td>[email protected]</td> 
    <td>$50.00</td> 
    <td>http://www.frank.com</td> 
</tr> 
<tr> 
    <td>Doe</td> 
    <td>Jason</td> 
    <td>[email protected]</td> 
    <td>$100.00</td> 
    <td>http://www.jdoe.com</td> 
</tr> 
<tr> 
    <td>Conway</td> 
    <td>Tim</td> 
    <td>[email protected]</td> 
    <td>$50.00</td> 
    <td>http://www.timconway.com</td> 
</tr> 
</tbody> 
</table>
</body> 
 </html>   

样式似乎有效,但没有排序。

这是表格目前的样子。 在此处输入图片说明

格斯克马

您忘记关闭脚本标签</script>

<script src="http://tablesorter.com/__jquery.tablesorter.min.js" type="text/javascript"/>

正确的标记:

<script src="http://tablesorter.com/__jquery.tablesorter.min.js" type="text/javascript"/></script>

我复制了您的代码,添加了</script>并且对我有用。同样来自http://tablesorter.com/jquery-latest.js的jquery文件确实已经过时(2008年),请考虑使用其他CDN,例如//code.jquery.com/jquery-1.10.2.min.js或googleapis

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章