How do I change my grid
<p>I am currently generating a grid dynamically in JQuery for my spelling game. At the moment the grid is a 6x6, because it deals with 3 letter words only. </p>

<p>The problem is I need to be able to change the amount of rows and columns for future development (adding bigger words etc). </p>

<p>Ideally I want to be able to change the rows and columns in HTML so that less experienced colleagues can change it's size when I am not there.</p>

<p>I have been looking at forms to take the data in HTML and pass it through to the JQuery, but I'm not sure if i get how I would do it with the JQuery I am using to create the grid as I am creating it from the words I have stored in a list in the body.</p>

<p>Could someone point me in the right direction?</p>

<p>Here is the script that generates the grid...</p>

<pre><code>var listOfWords = [];
var rndWord = [];
var counter = 0;
var ul = document.getElementById("wordlist");
var i;

for (i = 0; i &lt; ul.children.length; ++i) {

    listOfWords.push({
        "name": ul.children[i].getAttribute("data-word"),
        "pic": ul.children[i].getAttribute("data-pic"),
        "audio": ul.children[i].getAttribute("data-audio")
     });
}

var chosenWords = [];
var copylist = listOfWords.slice();

for (var x = 0; x &lt; 6; x++) {
    var rand = Math.floor(Math.random() * (copylist.length));
    chosenWords.push(copylist[rand].name);
    copylist.splice(rand, 1);
    if (chosenWords.length &lt; 12) {
        chosenWords.push('   ');
     }

 }

var shuffledWords = [];
shuffledWords = chosenWords.sort(function() {
    return 0.5 - Math.random()
});

 var guesses = {};
var tbl = document.createElement('table');
tbl.className = 'tablestyle';
var wordsPerRow = 2;

for (var i = 0; i &lt; shuffledWords.length - 1; i += wordsPerRow) {

    var row = document.createElement('tr');
    for (var j = i; j &lt; i + wordsPerRow; ++j) {
        var word = shuffledWords[j];
        guesses[word] = [];

        for (var k = 0; k &lt; word.length; ++k) {
            var cell = document.createElement('td');


            $(cell).addClass('drop-box').attr('data-word', word).attr('data-letter', word[k]);
            cell.textContent = word[k];

            row.appendChild(cell);
        }
    }

    tbl.appendChild(row);
}

$(".container").append(tbl);
</code></pre>

<p>I store the words and the attached sounds and pics like this...</p>

<pre><code>    &lt;li data-word="mum" data-audio="http://www.wav-sounds.com/cartoon/porkypig2.wav" data-pic="http://www.clker.com/cliparts/5/e/7/f/1195445022768793934Gerald_G_Lady_Face_Cartoon_1.svg.med.png"&gt;&lt;/li&gt;

    &lt;li data-word="cat" data-audio="http://www.wav-sounds.com/cartoon/bugsbunny2.wav" data-pic="http://www.clker.com/cliparts/c/9/9/5/119543969236915703Gerald_G_Cartoon_Cat_Face.svg.med.png"&gt;&lt;/li&gt;

    &lt;li data-word="dog" data-audio="http://www.wav-sounds.com/cartoon/daffyduck1.wav" data-pic="http://www.clker.com/cliparts/a/2/c/0/1195440948271207911zeimusu_spotty_dog.svg.med.png"&gt;&lt;/li&gt;

    &lt;li data-word="bug" data-audio="http://www.wav-sounds.com/cartoon/daffyduck2.wav" data-pic="http://www.clker.com/cliparts/4/b/4/2/1216180545881311858laurent_scarabe.svg.med.png"&gt;&lt;/li&gt;

    &lt;li data-word="rat" data-audio="http://www.wav-sounds.com/cartoon/bugsbunny1.wav" data-pic="http://www.clker.com/cliparts/C/j/X/e/k/D/mouse-md.png"&gt;&lt;/li&gt;

    &lt;li data-word="dad" data-audio="http://www.wav-sounds.com/cartoon/porkypig1.wav" data-pic="http://www.clker.com/cliparts/3/a/6/6/119544474191128182Gerald_G_Man_Face_6_-_World_Label.svg.med.png"&gt;&lt;/li&gt;
</code></pre>
