Solution 1 :

In JavaScript you can define so called event listeners.

This means basically the elements, eg your image, is waiting for something to happen – e.g. when it gets dragged. This would be a drag event.

When you then move the mouse to another cell, and drop the image, this would be a drop event.

Please have a look at the documentation, there is even a complete example.

https://developer.mozilla.org/en-US/docs/Web/API/Document/drag_event

Problem :

I am creating a web application, I want to render a small image into HTML table, and be able to move it in the table cells.
I am using Python, JavaScript, HTML and CSS in my project.

This is the idea, but I want the object to move inside the cells:
This is the idea, but I want the object to move inside the cells

Comments

Comment posted by J├╝rgen Gmach

You need to clarify what triggers the movement.

Comment posted by Isa Kurbanov

The movement is triggered with a mouse drag, I don’t know how that is referred to in JavaScript, I am a Python guy.

By