Yes, the number of rows and columns of the table can be variable depending on the random parameters. Arrays can be dynamically created in numerous ways. You can push or unshift elements in loops, or just assign to a particular index (even an index that doesn't already exist in the array). You can even have a variable number of answer rules. You will probably need additional arrays to contain answer rules in that case.
WeBWorK Main Forum
Dynamic tables
This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 10 posting(s) in 1 day