Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8260249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:03:35+00:00 2026-06-08T03:03:35+00:00

I am using the jQuery Table Sorter located here and it is not sorting

  • 0

I am using the jQuery Table Sorter located here and it is not sorting my table. I’ve used the exact same code for a simple test page and it works no problem. If anyone could point out what could possibly be causing my issue in my code that would be wonderful.

Here is the code calling the JS files, the paths are correct.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../css/style.css" />
<script type="text/javascript" src="../js/jquery-latest.js"></script> 
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
</head>

Here is a snippet of my code that contains the table that requires sorting.

<div id="roster">
<?php
$guildRealm = "taken out";
$guildName = "taken out";

$json = file_get_contents("http://us.battle.net/api/wow/guild/".$guildRealm."/".$guildName."?fields=members");
$json= json_decode($json);
$name = $json->name;
$level = $json->level;
$achievementPoints = $json->achievementPoints;

?>

<span class="h2"><?php echo $name; ?></span><br />
<span class="h4">Level: <?php echo $level; ?></span><br />
<span class="h5"><img src="images/guild_achievement_icon.png" width="38" height="32">    </span><span class="AP"><?php echo $achievementPoints; ?></span><br />
<table id="gRoster" class="tablesorter" width="100%" cellspacing="0">
<thead>
<tr class="roster-header">
    <th width="5%"></th>
    <th align="left">Name</th>
    <th align="center">Rank</th>
    <th align="center">Level</th>
    <th align="center">Class</th>
    <th align="center">Race</th>
    <th align="center">Achievement Points</th>
</tr>
</thead>

<?php
$count = 0;

foreach($json->members as $p) {
    $mrank = $p->rank;
    $mname = $p->character->name;
    $mclass = $p->character->class;
    $mrace = $p->character->race;
    $mgender = $p->character->gender;
    $mlevel = $p->character->level;
    $mthumb = $p->character->thumbnail;
    $machievement = $p->character->achievementPoints;
    $colour = "default";
    $mraceImage = "images/inv_misc_questionmark.jpg";
    $mclassImage = "images/inv_misc_questionmark.jpg";
    $mgrank = "";

    // Alot of if statements go here that just display how some of the content is display, already tested and they do not cause the problem.

    if ($count%2==0) {
        echo "<tbody>";
        echo "<tr class=\"even\">";
        echo "<td class=\"roster-avatar\"><img src=\"http://us.battle.net/static-render/us/".$mthumb."?alt=/wow/static/images/2d/avatar/".$mrace."-".$mgender.".jpg\" width=\"40\" height=\"40\" class=\"".$colour."\"></td>";
        echo "<td class=\"roster-name\"><span class=\"".$colour."\">".$mname."</span></td>";
        echo "<td align=\"center\">".$mgrank."</td>";
        echo "<td align=\"center\">".$mlevel."</td>";
        echo "<td align=\"center\"><img src=\"".$mclassImage."\" /></td>";
        echo "<td align=\"center\"><img src=\"".$mraceImage."\" /></td>";
        echo "<td align=\"center\">".$machievement."</td>";
        echo "</tr>";
        echo "</tbody>";
    } else {
        echo "<tbody>";
        echo "<tr class=\"odd\">";
        echo "<td class=\"roster-avatar\"><img src=\"http://us.battle.net/static-render/us/".$mthumb."?alt=/wow/static/images/2d/avatar/".$mrace."-".$mgender.".jpg\" width=\"40\" height=\"40\" class=\"".$colour."\"></td>";
        echo "<td class=\"roster-name\"><span class=\"".$colour."\">".$mname."</span></td>";
        echo "<td align=\"center\">".$mgrank."</td>";
        echo "<td align=\"center\">".$mlevel."</td>";
        echo "<td align=\"center\"><img src=\"".$mclassImage."\" /></td>";
        echo "<td align=\"center\"><img src=\"".$mraceImage."\" /></td>";
        echo "<td align=\"center\">".$machievement."</td>";
        echo "</tr>";
        echo "</tbody>";
    }
    $count++;
}
?>
</table>

<script type="text/javascript">
$(document).ready(function() 
    { 
        $("#gRoster").tablesorter();
    } 
); 
</script>
</div><!--- roster --->
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:03:36+00:00Added an answer on June 8, 2026 at 3:03 am

    I see two possibilities:

    1. you create more then one -block
    2. your variables are not HTML-safe (like $machievement could contain HTML-relevant characters) – you should at least use htmlspecialchars()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Jquery table addrow plugin to add row dynamically, the code
I've a code to sort table using Jquery.I use toggle function to alternate clicks,and
I am using a Jquery Tablesorter plugin for sorting a table.I want, when I
When I add to table using jQuery $('#myTable > tbody:last').prepend('<tr><td>test</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>'); The form wrapped by
I am using the jQuery tableSorter plugin on a page. Unfortunatley, the table that
Here's the thing: file a.php contains jQuery Tablesorter table. This is the Tablesorter code:
I have a simple question regarding jQuery selectors. I'm using the tablesorter and I
I'm using the jQuery Table to CSV Plugin. I've altered the popup so that
How to remove using jquery html table row after checking checkbox that in this
I'm using the jQuery tablesorter plugin to sort a table, which assigns .click() handlers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.