jQuery plugin で、Excel のように編集できるもの。
http://handsontable.com/index.html
github
JSの指定は、サンプルのように、配布されてる jquery.handsontable.full.js を使用
CSS は、、jquery.handsontable.full.css が配布されてる。
例えば、ドラッグして自動入力。。。。。
すると、以下のようになる。
HTML <div>で書きたいところに、、
<div id="example" class="handsontable"></div>
JavaScript は、、
$(function(){
var data = [
["", "Kia", "Nissan", "Toyota", "Honda"],
["2008", 10, 11, 12, 13],
["2009", 20, 11, 14, 13],
["2010", 30, 15, 12, 13],
["2011", "", "", "", ""],
["2012", "", "", "", ""]
];
$('#example').handsontable({
data: data,
minSpareRows: 1,
colHeaders: true,
contextMenu: true
});
});
row = 2 , column = 3 の値を取り出す場合、、
var row2col3 = $("#example").handsontable('getDataAtCell', 2, 3);
console.log('value23 = ' + row2col3 );
その他、Method の説明を見ると良い。