Question: I have a tablesorter table, inside which I have one of the TDs updating every 20 seconds, as the data changes and I pull the new value from the database, with this code:

```
window.setInterval(function(){
    $("td.odds span").each(function(){
        var id=$(this).parent().attr("rel");
        $(this).load("/td.php?id="+id);
    });
},20000);

```

What I'd like to know is if it's possible to then re-sort the table after this, incase any values have changed (as, if they have, there is a chance now the table is actually in the wrong order).

I've tried adding the following code without success:

```
var sorting=[[11,0]]; 
$("table.formguide").trigger("sorton",[sorting]);

```

And:

```
$("table.formguide").trigger("update");

```

But no success. Any help appreciated.

Answer: 
You could try using the `updateCell` method to specifically target the modified cell, then apply a `sorton` method to resort that column.

```
var cell = $('table.formguide td.odds span').each(function(){
    $('table.formguide').trigger('updateCell', [ this ]);
});
$('table.formguide').trigger('sorton', [ [[11,0]] ]);

```

Or, you could check out my [fork of tablesorter](http://mottie.github.io/tablesorter/docs/) which has modified the [`updateCell` method](http://mottie.github.io/tablesorter/docs/#updatecell) to include a flag to automatically resort using the current sort

```
var last,
    // resort is true by default, but we set it to false until all cells have updated
    resort = true,
    // callback function run on the last updated cell
    callback = function(){ /* do something after each updateCell */ },
    // updated cells
    $cells = $('table.formguide td.odds span'),
    len = $cells.length

$cells.each(function(i){
    last = i === len;
    // don't resort or trigger a callback until we're on the last cell
    $('table.formguide').trigger('updateCell', [ this, last ? resort : false, last ? callback : null ]);
});

```
Use `updateAll` instead, there is an [example](http://mottie.github.io/tablesorter/docs/example-update-all.html) using tablesorter v2.8.

```
  var resort = true, // re-apply the current sort
    callback = function(){
      // do something after the updateAll method has completed
    };

  // let the plugin know that we made a update, then the plugin will
  // automatically sort the table based on the header settings
  $("table").trigger("updateAll", [ resort, callback ]);

```