Perhaps this can help you achieve your goal.
If you can return a string from a.writeInTable() you can use the javascript eval() function
[
^] to create a 2d array. Consider this example:
<html>
<body>
<script type="text/javascript">
var mystring = "mytable=[['Saab','Volvo','BMW'],['Apple','Orange','Lemon']]";
eval(mystring);
for (i=0;i<mytable.length;i++)>
{
for (j=0;j<mytable[i].length;j++)>
{
document.write(i+ ',' + j + ': ' + mytable[i][j] + "<br />");
}
}
</script>
</body>
</html>
This will show the following result:
0,0: Saab<br />
0,1: Volvo<br />
0,2: BMW<br />
1,0: Apple<br />
1,1: Orange<br />
1,2: Lemon
For more information on 2d arrays take a look at this thread:
http://www.webdeveloper.com/forum/showthread.php?t=90849[
^]