# Sortable table rows?

**URL:** <https://www.ruby-forum.com/t/sortable-table-rows/58675>\
**Category:** Rails\
**Created:** [April 24, 2006, 7:01pm UTC](https://www.ruby-forum.com/t/sortable-table-rows/58675 "2006-04-24T19:01:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![agnathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@agnathan](https://www.ruby-forum.com/u/agnathan)\
**Post date:** [April 24, 2006, 7:01pm UTC](https://www.ruby-forum.com/t/sortable-table-rows/58675/1 "2006-04-24T19:01:28Z")

</div>

I’ve been trying to make some table rows sortable using Scriptaculous.  
I’ve  
used:

Sortable.create(“secondlist”, {tag:‘tr’, treeTag:‘table’});

and

Sortable.create(“secondlist”, {tag:‘tr’});

Neither of which works. Is it even possible to do this?

Thanks,  
Daniel

---

<div class="post-metadata">

**Author:** ![agnathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@agnathan](https://www.ruby-forum.com/u/agnathan)\
**Post date:** [April 24, 2006, 7:10pm UTC](https://www.ruby-forum.com/t/sortable-table-rows/58675/2 "2006-04-24T19:10:28Z")

</div>

I used this excellent javascript library for the same thing

[http://kryogenix.org/code/browser/sorttable/](http://kryogenix.org/code/browser/sorttable/)

There is a table sorter ticket posted in scriptaculous requested  
enhancements  
[http://dev.rubyonrails.org/ticket/2606](http://dev.rubyonrails.org/ticket/2606)

I dont know if this has been included yet. I have seen some sorttable  
lists but dont think there is anything specific for tables but the  
sorttable.js link i have provided is as good as i anything ive seen out  
there.

---

<div class="post-metadata">

**Author:** ![agnathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@agnathan](https://www.ruby-forum.com/u/agnathan)\
**Post date:** [April 24, 2006, 7:23pm UTC](https://www.ruby-forum.com/t/sortable-table-rows/58675/3 "2006-04-24T19:23:17Z")

</div>

Thanks Johnny B-

I’m actually using that currently 🙂 My goal is to have table rows  
sortable  
using the kryogenix script AND by using drag and drop, like you can do  
with  
lists. That way if someone wants to compare to rows side by side, he  
can.

The scriptaculous Sortable class(?) relies on Draggables and  
Droppables…  
and as far as I can tell you can’t make

's draggable unless you  
change  
their position to absolute, which is totally counterproductive 🙂

Daniel
