Certainly the above will work if the string is known at the time of table creation.
If the string isn't known until after the page is drawn, however, a trick I like to employ is to put anchors in the cells of the table and then fill the innerHTML of the anchors when I know the values I want to insert.
Here's a row of a sample table:
<TR>
<TD><A NAME=CELL1_1></A></TD>
<TD><A NAME=CELL1_2></A></TD>
<TD><A NAME=CELL1_3></A></TD>
</TR>
Now, when the string becomes known to and split by javascript, assuming you know where you want the information to go, you can use the following javascript commands:
CELL1_1.innerHTML = myArray[k]; //for example
A peculiarity this leads to, however, is that if someone does a View-Source on the page, they will see only empty anchors in the table.
If your cells will always be filled in the same order, you can play around with this trick:
name all the anchors the same thing, then put an onLoad in your BODY tag to call function "collectAnchors()" as such:
var anchors;
function collectAnchors()
{
anchors = document.getElementsByName('ANCHOR');
/*in this case, all anchors of interest have the NAME attribute set equal to 'ANCHOR'*/
}
Now, after your string is split into an array, you can use the following JavaScript:
for(i=0; i<myArray.length; i++)
anchors.innerHTML = myArray;
'hope this helps.
--Dave