Jump to content

Jquery Table Sorter


Tazz

Recommended Posts

Once again I'm stuck with some jquery...

 

I am trying to implement the table sorter plugin. http://tablesorter.com/docs/

 

Here is some demo code:

<!doctype html public "-//w3c//dtd html 3.2 final//en">
<html>
    <head>
        <title>Table Sorter Test</title>
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="jquery.tablesorter.js"></script>
        <script type="text/javascript">
            $(function()
            {
                $("#tablesorter-demo").tablesorter();
            }
        );
        </script>
    </head>
    <body>
        <table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
            <thead>
                <tr>
                    <th>first name</th>
                    <th>last name</th>
                    <th>age</th>
                    <th>total</th>
                    <th>discount</th>
                    <th>difference</th>
                    <th>date</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>peter</td> <td>parker</td> <td>28</td> <td>$9.99</td> <td>20.9%</td> <td>+12.1</td>
                    <td>jul 6, 2006 8:14 am</td>
                </tr>
                <tr>
                    <td>john</td>
                    <td>hood</td>
                    <td>33</td>
                    <td>$19.99</td>

                    <td>25%</td>
                    <td>+12</td>
                    <td>dec 10, 2002 5:14 am</td>
                </tr>
                <tr>
                    <td>clark</td>
                    <td>kent</td>
                    <td>18</td>
                    <td>$15.89</td>
                    <td>44%</td>
                    <td>-26</td>
                    <td>jan 12, 2003 11:14 am</td>
                </tr>
            </tbody>
        </table>
    </body>
</html>

 

The jquery.js file I am referencing in the <head> is the latest jquery 1.3.2 and the tablesorter js file is the minified one downloaded from the url at the top of this post.

 

For some weird reason I cant get it to work. What am I doing wrong?

Link to comment
https://forums.phpfreaks.com/topic/187109-jquery-table-sorter/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.