My JavaScript code goes through a for loop and outputs pictures in a table. The problem is that if there are 36 or so pictures, the table stretches the page. After about every 4 pics, I want a </tr><tr> placed into the code. Is it possible to do that?
Code:
for (var i = 0; i < photos.length; i++)
{
document.write('<td><a href="images/' + photos[i] + '.jpg" title="Click to enlarge" rel="lytebox">');
document.write('<img src="images/' + photos[i] + '.jpg" alt="" class="small" /></a><br />');
document.write('Photo ' + (i + 1) + '</td>');
}