I have this code to try and sort the table by lowest price to highest price (the table is populated by ajax).
Heres the sorting code i have
$("#tableid tbody tr")
.detach()
.sort(function(a, b) {
var dataA1 = $(a)
.find("td:eq(5)")
.text()
.trim();
var dataB1 = $(b)
.find("td:eq(5)")
.text()
.trim();
return parseFloat(dataA1.substring(1)) - parseFloat(dataB1.substring(
1));
})
.appendTo('#tableid');
However i do have an issue with this that keeps happening
As you can see this is broken. the blank rows do have some text in and is in a colspan 6
. What i'm wanting is these to be at the bottom of the table and the results at the top.
Any ideas how to do this?
Aucun commentaire:
Enregistrer un commentaire