Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Editing an HTML table cell

I have a table with a few rows... I want to be able to select a row and click on modify and I should be able to make all the cells of that row editable...

How would I make a cell editable in Javascript? And is it better to use Jquery?

like image 478
user248011 Avatar asked Jan 11 '10 12:01

user248011


People also ask

How do you make an editable field in HTML?

Answer: Use the HTML5 contenteditable Attribute You can set the HTML5 contenteditable attribute with the value true (i.e. contentEditable="true" ) to make an element editable in HTML, such as <div> or <p> element.

How do you edit an element in HTML?

Editing HTML You can edit the HTML — tags, attributes, and content — directly in the HTML pane: double-click the text you want to edit, change it, and press Enter to see the changes reflected immediately. You can add any HTML in here: changing the element's tag, changing existing elements, or adding new ones.


1 Answers

There's no need to do your own code, a plugin for jQuery for this very purpose exists already. Try jEditable, it can do exactly what you need.

Their demo page has some nice examples:

http://www.appelsiini.net/projects/jeditable/default.html

like image 109
Tatu Ulmanen Avatar answered Oct 02 '22 21:10

Tatu Ulmanen