I'm looking for a way to make a table cell editable when double-clicked so that I can input some values into the cell:
https://i.sstatic.net/1r1sq.png
Currently, my approach involves placing an input box inside the td element when it is double-clicked:
$('<input type="text" />').val(oldCellval).appendTo($this).end().focus().select();
The variable $this
represents the td
element where I want the input box to appear on double click. Upon blur, I remove the input box and set the new value back.
I am seeking a solution to display the input box over the td element rather than inside it, as my table library only allows text within td
elements. When I add an HTML element like input
inside the td, it does not function correctly. Any assistance would be greatly appreciated.