无法在jQuery tablesorter中显示向上/向下箭头

时间:2017-01-29 16:29:11

标签: jquery tablesorter

我已经使用jQuery TableSorter 2.0,以便单击列标题排序。但我不能让向上/向下箭头显示出来。为简化起见,我使用https://mottie.github.io/tablesorter/docs/index.html中的示例创建了一个页面。这是测试页面的代码:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Testing</title>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script type="text/javascript" src="bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="tablesorter/js/jquery.tablesorter.js"></script>
    <!-- <script type="text/javascript" src="tablesorter/js/jquery.tablesorter.widgets.js"></script> -->
    <!-- <link href="tablesorter/css/theme.bootstrap.css" rel="stylesheet" type="text/css" /> -->


 <script type="text/javascript">
 $(document).ready(function() 
            { 
                $("#myTable").tablesorter(); 
            } 
        ); 
</script>    
 </head>
 <body>
 <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> 
</body>
</html>

当我在浏览器中打开页面时(我尝试过FireFox和Edge),列按预期排序,但没有向上/向下箭头。

我已经查看了有关此问题的其他帖子,但解决方案要么不适合我的情况,要么没有帮助。

我尝试使用和不使用显式CSS链接,以及我在css文件夹中看到的几个不同的主题。

1 个答案:

答案 0 :(得分:2)

使用up/down文件(主题文件)生成css箭头。

您应该同时使用bootstrap&#39s的css文件:

<link rel="stylesheet" href="/path/to/bootstrap-v3.min.css" />

theme.css文件:

<link rel="stylesheet" href="/path/to/theme.default.css" />
相关问题