This may help you get started:
Code:
<html>
<head>
<title>Table Editor</title>
<script type="text/javascript">
function makeRowEditable(Row)
{
var iRowIndex = Row.rowIndex;
for (var i = 1; i < Row.cells.length; i++)
{
var oCell = Row.cells[i];
var sNewName = "txt_R" + iRowIndex + "_C" + i;
makeCellEditable(oCell, sNewName, oCell.innerText); //Change second parameter to something else if you want different value in textbox.
}
}
function makeCellEditable(Cell, NewName, InitialValue)
{
var oInput = document.createElement("<input name=\"" + NewName + "\" type=\"text\">");
oInput.value = InitialValue;
oInput.size = 3;
Cell.removeChild(Cell.childNodes[0]);
Cell.appendChild(oInput);
}
</script>
</head>
<body>
<table size="80%" align="center">
<tbody>
<tr>
<td width="40%"><input type="button" value="Edit Row" onclick="makeRowEditable(this.parentElement.parentElement);"></td>
<td width="20%">1</td>
<td width="20%">2</td>
<td width="20%">3</td>
</tr>
<tr>
<td><input type="button" value="Edit Row" onclick="makeRowEditable(this.parentElement.parentElement);"></td>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
</tbody>
</table>
</body>
</html>
--
Joe (Co-author Beginning XML, 3rd edition)