I'm trying to sort my table with table sorter and it is not working
<html>
<head>
<link rel="stylesheet" href="blueStyle.css" type="text/css" media="print, projection, screen" />
<script src="http://tablesorter.com/jquery-latest.js" type="text/javascript"></script>
<script src="http://tablesorter.com/__jquery.tablesorter.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#myTable").tablesorter();
});
</script>
</head>
<body>
<table id="myTable" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<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>[email protected]</td>
<td>$50.00</td>
<td>http://www.jsmith.com</td>
</tr>
<tr>
<td>Bach</td>
<td>Frank</td>
<td>[email protected]</td>
<td>$50.00</td>
<td>http://www.frank.com</td>
</tr>
<tr>
<td>Doe</td>
<td>Jason</td>
<td>[email protected]</td>
<td>$100.00</td>
<td>http://www.jdoe.com</td>
</tr>
<tr>
<td>Conway</td>
<td>Tim</td>
<td>[email protected]</td>
<td>$50.00</td>
<td>http://www.timconway.com</td>
</tr>
</tbody>
</table>
</body>
</html>
The styling seem to work, but there is not sorting.
This is what the table looks like at the moment.
You forgot to close a script tag </script>
:
<script src="http://tablesorter.com/__jquery.tablesorter.min.js" type="text/javascript"/>
Correct markup :
<script src="http://tablesorter.com/__jquery.tablesorter.min.js" type="text/javascript"/></script>
I copied you code, added </script>
and it works for me. Also jquery file from http://tablesorter.com/jquery-latest.js is really outdated (2008), consider using other cdn like //code.jquery.com/jquery-1.10.2.min.js or googleapis
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments