I am creating a table dynamically in javascript. Also i am suing some css code to format the tables. However, my code is not picking up any formatting. Not even the simplest ones like adding a border around table. Here is my code :
function parseRequest_ls(response) {
document.getElementById("files").innerHTML += "<table border='2'>";
for(var i=0;i<5;i++){
if(response.data[i].type == "folder" || response.data[i].type == "album") {
document.getElementById("files").innerHTML += "<tr><td><b>+</b> <a href='#'>"+ response.data[i].name + "</a></td></tr>";
}
}
document.getElementById("files").innerHTML += "</ul></table></div>";
}
CSS Code:
table, th, td {
border: 2px solid;
border-collapse: collapse;
font-family: "Trebuchet MS", Arial, sans-serif;
color: #555;
}
caption {
font-size: 150%;
font-weight: bold;
margin: 5px;
}
td, th {
padding: 4px;
}