I have this code here where it can generate a list from the values in the database. The problem is it only displays 1 column. How can I display 2 columns in a list by correcting this code?
desired display:
(from column1) (from column2)
○ (some booktitle) (some bookauthor)
○ (some booktitle) (some bookauthor)
○ (some booktitle) (some bookauthor)
code: (fldBookTitle is the Column name and the second is fldBookAuthor)
function listBooks(){
db.transaction(function (tx){
tx.executeSql('SELECT * FROM tblBooks', [], function(tx, results){
var len = results.rows.length, i;
var listContainer = document.createElement("div");
document.getElementsByTagName("body")[0].appendChild(listContainer);
var listElement = document.createElement("ul");
listContainer.appendChild(listElement);
for(i=0;i<len;++i){
var listItem = document.createElement("li");
listItem.innerHTML = results.rows.item(i).fldBookTitle;
listElement.appendChild(listItem);
}
});
//console.log("table created");
});
}
thanks for any help.