Editable table with jQuery and Bootstrap
Bootstrap 4 jQuery 1.7.1+
This is the minimum code to make an editable table
$('table').tableEditor()
If you want to set options add an object which contains your options as parameters
$('table').tableEditor({
// Localization
// Supported: English (en, default) and Spanish (es)
lang: 'en',
// onChange event
onChange: function(value, cell, table, tableEditor) {
// ..
}
})
Convert table to JSON
$('table').tableEditor('json')
Convert JSON to table
$('table').tableEditor('json', '[["1","2","3","4","5"],["6","7","8","9","0"]]')
When you wish, you can restore the previous state of the table
$('table').tableEditor('destroy')