nathanbweb nathanbweb - 10 months ago 53
Javascript Question

Use tablesorter jQuery plugin with YQL-generated table

I'm trying to use the tablersorter jQuery plugin (, but I can't get it to work with a table that's dynamically populated via YQL from a Google Doc (using Christian Heilmann's example)

I'm trying to do something like this:


Name Team Position Time Shots six seven eight
Abdoun Algeria Midfielder 16 0 6 0 0
Abe Japan Midfielder 351 0 101 14 0
Abidal France Defender 180 0 91 6 0

I have tablesorter working in this example with a static table:

What am I doing wrong?


You should put $("#results").tablesorter(); inside getJSON callback function, not after it. You are calling tablesorter() on results table before it is created.

Edit: You should also change <td> elements to <th> elements inside <thead> for sorting to work.