Hi, All
I've tested this code on firefox and IE.
For some reason the table in this code doesn't work,
the code it's self works fine and if i change the td's
for font's then it displays the way it should. The answer
might be simple, but if it is i can't see it.
The Code ..
Any help would be great, Thanks for reading.
I've tested this code on firefox and IE.
For some reason the table in this code doesn't work,
the code it's self works fine and if i change the td's
for font's then it displays the way it should. The answer
might be simple, but if it is i can't see it.
The Code ..
Code:
<body onload='Getlist();' leftmargin=0 topmargin=0>
<script>
var s="#2111~bob~22~Spain#3221~paul~26~USA#5476~sam~45~UK";
function Getlist() {
var users = s.split("#");
for(i=1; i<users.length; i++){
user = users[i].split("~");
users[i]={
userID: user[0],
userName: user[1],
age: user[2],
location: user[3]
}
}
var list = document.getElementById("list");
list.innerHTML = "<table width=100%>";
for(i=1; i<users.length; i++){
list.innerHTML += "<tr><span id="+users[i].userID+"><td style='width:20%;background:black;color:white'>"
+users[i].userName+"</td><td style='text-align:center;width:10%;background:black;color:red'>"
+ users[i].age +"</td><td style='width:70%;background:black;color:red'>"
+ users[i].location+"</td></tr>";
}
list.innerHTML += "</table>";
}
</script>
HTML CODE
<SPAN id="list">
</SPAN><br>
HTML CODE
Any help would be great, Thanks for reading.