here is something like what you mention, perhaps it can be of use...
[PHP]<table>
<tr> <td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
</tr><tr>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
</tr><tr>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
<td><input type='text' /></td>
</tr></table>
<br />
<textarea id="ta1" rows="15" cols="60" ></textarea>
<script>
var ray=[[]]; //the array to store table changes
// some support code
function el(tid) { return document.getElementById(tid);}
function tags(elm){ var o=[], i=0, r=document.getElementsByTagName(elm), mx=r.length; for(var z=0;z<mx ;z++) {o[z]=r[z]} ; return o; }
function getParent(elm, tagname) { tops:for (var z = 0; z < 99; z++) {var t = elm.parentNode ? elm.parentNode : elm.parentElement ? elm.parentElement : elm;if (!t.tagName) {return elm;}if (!tagname) {return t;}if (tagname==(tagname * -1 )) {if (z == tagname) {return t;}elm = t;continue tops;}if (t.tagName.toLowerCase().match(tagname.toLowerCase ())) {return t;}elm = t;}}
//custom code below
for(var z=0, mx=tags("tr").length; z<mx;z++){ ray[z]=[]; } //init array by length of table row (writing a col to an undefined row cause error!)
for(var z=0,tg=tags("input"), mx=tg.length; z<mx;z++){ //updrage all the text inputs to modify the array
var t=tg[z];
t.value=0;
t.size=4;
t.setAttribute("onchange","doRay(this)");
}//next text input
function doRay(t){ //modify the array with the value of the cell
var col=getParent(t, "td").cellIndex ||0;
var row=getParent(t, "tr" ).rowIndex || 0;
ray[row][col]=t.value;
el("ta1").value=ray.join("\n");
}//end function doRay update
</script>[/PHP]