日期:2014-05-16  浏览次数:20358 次

使用jQuery的tablesorter设置表头样式
JScript code
 
    <script type="text/javascript" src="js/jquery.tablesorter.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#tabelTest").tablesorter({ sortList: [[0, 0], [1, 0]], cssHeader: "cursor: pointer;" })
        });
    </script>



HTML code

<table id="tabelTest" 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> 




设置之后没效果,参考的这里http://tablesorter.com/docs/,大家帮忙看看是不是用法不正确。

------解决方案--------------------
参考demo就可以了

样式也可以用css来写