I have code that loops through and displays through document.write. I want to limit the display to 3 columns, but unlimited rows. I will past the code code below, but basically, the space I have to work with is the width of 3 columns but I have more than 3 columns of data. So I want the loop to stop at 3 and continue on the next row, but have unlimited rows. Code pasted here:
enter code here
<script type="text/javascript">
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", "/_SHARED/ApplicationData/Public/FlashWriter.aspx?RotatorGroupID=5357", false);
xmlhttp.send();
xmlDoc = xmlhttp.responseXML;
var x = xmlDoc.getElementsByTagName("jpg");
document.write("<table border='0' width='675' cellspacing='0' cellpadding='0'>");
document.write("<tr>");
for (i = 0; i < x.length; i++) {
document.write("<td><table border='0' cellspacing='0' cellpadding='0' id='static' ><tr><td class='HOT969' colspan='3'><a href='");
document.write(x[i].attributes.getNamedItem("link").value);
document.write("'><img width='190' height='125' class='image' src='");
document.write(x[i].attributes.getNamedItem("image").value);
document.write("'><br><div class='head'>");
document.write(x[i].attributes.getNamedItem("head").value);
document.write("</div><div class='copy'>");
document.write(x[i].attributes.getNamedItem("desc").value);
document.write("</div></a></td></tr></table></td>");
}
document.write("</tr>");
document.write("</table>");
Thanks in advance