Hi,
I'm loading xml data in a table which is in a div. I want each item to load in it's own column with only 3 columns per row. I can get the data to load in it's own column but only one column per row. I can also get it to load only three items from the xml file and then goto the next line but then I can't get them to load in columns.
Please help.
Here is my code:
Code:
function displayDOMlist(){
document.getElementById("cat_title").innerHTML="<img src='img/beer_dom_tl.png'>";
x=xmlDoc.getElementsByTagName("BEER");
t=document.getElementById("beerlist");
t.innerHTML="<tr>";
mltple=1;
for (i=0;i<x.length;i++){
naam=(x[i].getElementsByTagName("NAME")[0].childNodes[0].nodeValue);
info=(x[i].getElementsByTagName("INFO")[0].childNodes[0].nodeValue);
pic=(x[i].getElementsByTagName("PIC")[0].childNodes[0].nodeValue);
if (mltple % 3){
t.innerHTML+="<td width='100'><a href="+pic+">"+naam+"</a></td>";
} else {
t.innerHTML+=naam+"</tr><tr>";
}
mltple++;
}