How to make a table sortable by CCK field An odd question: I have a custom column added to the default admin/content page that shows the value of a CCK field "field_foo". I'm trying to sort the table by this field. (I can't use Views for this unfortunately). This is what I have for the header:

$header = array(
  'title' =&gt; array('data' =&gt; t('Title'), 'field' =&gt; 'n.title'),
  'foo' =&gt; array('data' =&gt; t('Foo'), 'field' =&gt; 'n.field_foo', 'sort' =&gt; 'desc');
)
$query = db_select('node', 'n')
   -&gt;extend('PagerDefault')
   -&gt;extend('TableSort');
node_build_filter_query($query);


I also tried the name of the field as declared in the $rows, ie...  

'foo' =&gt; array('data' =&gt; t('Foo'), 'field' =&gt; 'n.foo', 'sort' =&gt; 'desc'); 


This results in a link at the top of the Foo column head, but when I try to click on the link to sort Asc or Desc it doesn't really work and the Foo values aren't ordered in the requested order. If anyone has any suggestions I'd really appreciate it. 
Thanks!
Try out Tablesorter moulde and add js function to your js file

$("Table").tablesorter();