Hi I wonder if someone can help please? I have successfully installed stupid table and it sorts when the head of each table is clicked. However I would like the table to sort when loaded on the 10th column ("Points"). Please find the code below and the suggested code below that. Does this code have to be in separate <scripts> or contained, I have tried several combinations without successes.
<title>Stupid jQuery table sort</title>
<script src="jquery-2.1.4.js"></script>
<script src="stupidtable.js"></script>
<script>
$(function() {
$("table").stupidtable();
});
</script>
<style type="text/css">
table {
border-collapse: collapse;
}
th, td {
padding: 5px 10px;
border: 1px solid #999;
}
th {
background-color: #eee;
}
th[data-sort]{
cursor:pointer;
}
tr.awesome{
color: red;
}
home {
}
home {
font-size: 14px;
background-color: #00F;
}
</style>
</style>
< !---- Above works OK--->
var $table = $("#table").stupidtable("Points");
var $th_to_sort = $table.find("thead th").eq("Points");
$th_to_sort.stupidsort("Points");
// You can also force a direction.
$th_to_sort.stupidsort('desc');
< !--- This does not-->