views:

226

answers:

1

Hi,

I would like to use jQuery and its drag-and-drop function, such as: http://jqueryui.com/demos/draggable/

In my case, I would like to enable drag-and-droping on content of an HTML table. For instance with a table of 20x20, in order to move a tag from a cell to an other cell.

Is that hard to do? I don't see any example after searchs. If you're got one or if you can show me how to process, I will be cool!

Thanks

+1  A: 

Have you tried implementing the examples from the link you posted? It's right on there! Give it a shot before posting here, man!

Maybe you didn't see this part, the Droppable

Jason
thx for the downvote, but i will stick by my statement. i'm not going to do your homework for you.
Jason
Sorry Jason, but it's not as simple as you could think. jQuery drag-and-drop don't really work for table content. Even if it's possible to drag-and-drop TD content from a cell to an other cell, this moved content is not center in its new cell. And after some tests it's seems to be much harder then you said. But it's fun (and it's not a homework ;)
Denis
have you tried putting your `<td>` content into a div? not get rid of your table, but do `<td><div class="myContent">Content</div></td>` and use the `<div>` s as your draggables?
Jason
Yes (div, span, ...) but it steal not work, and I think I will begin to search an other solution in order to finish my project. Thanks anyway.
Denis
It should work if you do it right. It doesn't care what container you put it in. Your selectors are probably incorrect...
Jason