• I am trying to use the jQuery Tablesorter with my tables and I can’t get it to work. I don’t know if it is a pathway problem with the scripts location or if I have left something out. Does anyone have any experience or success with Tablesorter working in WordPress?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Place this code to your header.php

    <script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/YourFolder/jquery-latest.js"></script>
    	<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/YourFolder/jquery.tablesorter.js"></script> />

    “YourFolder” is a folder under your theme directory, copy and paste jQuery-latest.js and jQuery.tablesorter.js to “YourFolder”

    In your post or page. place following code

    <table id="YourTableName">
    <thead>
    <tr>
        <th>No</th>
        <th>Name</th>
        <th>Address</th>
        <th>Salary</th>
        <th>Web Site</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>1</td>
        <td>John</td>
        <td>California</td>
        <td>$5000</td>
        <td>http://www.jhon.com</td>
    </tr>
    <tr>
        <td>2</td>
        <td>Udin</td>
        <td>Majalaya</td>
        <td>$10000</td>
        <td>http://www.udin.com</td>
    </tr>
    
    </tbody>
    </table>

    Place this code into javascript jquery.tablesorter.js

    $(document).ready(function()
        {
            $("#YourTableName").tablesorter();
        }
    );

    YorTableName is your table ID that you can change. you can customize your table.

    may be that’s what I know, I don’t know how to customize it with my css theme, anyone who can add?

    Thread Starter deserturchin

    (@deserturchin)

    Thank you very much. I got it to work if I write out the table manually but I will be using php generated tables and it doesn’t seem to work on the tables generated within the Loop. Do you know how to get around this?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘jQuery Tablesorter pathway problem’ is closed to new replies.