Sorry I don't understand the problem regarding JScript dynamic array usage (when you know nothing neither about final array dimensions no about number of elements of final table (or set of tables).
You may define any element in empty array and assign existing array as element for another array (getting two-dimensional array). You may define 3rd dimension etc.
Yes, you don't need to know actual size of arrays when define them. The final array size can be read from .length property and actual value in every cell can be checked with ( myArr[ index ] != undefined ) comparison.
Here the example of totally random array elements definitions.
function arrDemo()
{
var arrExample = [];
arrExample[ 14 ] = "string";
arrExample[ 23 ] = "string2";
for ( var index = 0; index < arrExample.length; index++ ) // array length = 24 (max index defined, counting from 0)
Log.Message( arrExample[ index ] );
Log.Message ( "----------------------------------------------------" );
var arrExampleSecondDimension = []; // empty array
arrExampleSecondDimension[ 25 ] = arrExample;
arrExampleSecondDimension[ 37 ] = [ "Value1", "Value2", "Value3" ];
arrExampleSecondDimension[ 25 ][ 18 ] = "New value"; // when one array "packed" into another it's possible to add/define new elements in it (and change it's length if necessary).
Log.Message( arrExampleSecondDimension[ 25 ][ 14 ] );
Log.Message( arrExampleSecondDimension[ 25 ][ 18 ] );
Log.Message( arrExampleSecondDimension[ 37 ][ 2 ] );
}