I have the following JavaScript code:
function addRowToTable()
{
var tbl = document.getElementById(\'tblSample\');
var lastRow = tbl.rows.length;
// if
Maybe something like this (but without select
): http://jsfiddle.net/dVBMc/3/
UPDATE: http://jsfiddle.net/dVBMc/6/
function addRowToTable(table, cell1, cell2) {
var row;
row = "" + cell1 + " " + cell2 + " ";
table.append(row);
}
Usage:
$(document).ready(function() {
$('button').click(function() {
addRowToTable($('table'), 'cell1 content', 'cell2 content');
});
});