Question: I have two to three variables that I want to mix into strings and then place them all into a table, however I can't figure out how to make the variables mix.

What I have is 

```
 document.write('<table cellspacing="0" cellpadding="5">')

 var a = ["String1", "String2"]
 var n = ["string3", "String4"]

 for(var i=0; i <a.length; i++){
    document.write('<tr'>
    document.write('td' + (a[i]) + (b[i]) +'</td>')
    document.write('</td>')

}
document.write('</table>')

```

This does create the table I want however it doesn't perform the function I am looking for. 

It creates a table that goes:

"string1" "string3"

"string2" "string4'

I'm looking for:

"string1" "string3"

"string1" "string4"

"string2" "string3"

"string2" "string4" 

Hopefully that makes sense. I've tried searching through the internet and on Stack Overflow to no avail. How would I make this happen? Eventually the arrays should be able to grow to maybe a hundred each...

Answer: 
You need an additional loop - 

```
for(var i = 0; i < a.length; i++) {
    for (var j = 0; j < b.length; j++) {
        document.write('<tr'>);
        document.write('<td>' + a[i] + b[j] + '</td>');
        document.write('</td>');
    }
}

```

P.S.: Do you really need to create elements using `document.write`? It's OK if it's an example, but this style of element creation is strongly discouraged in real development code.
```
document.write('<table cellspacing="0" cellpadding="5">');

var a = ["String1", "String2"]; 
var b = ["string3", "String4"];

for(var i=0; i <b.length; i++){
    for (var j=0;j<a.length;j++){
        document.write('<tr>');
        document.write('<td>' + (a[i]) + (b[j]) +'</td>');
        document.write('</td>');
    }
} 

document.write('</table>');

```