I am using the below to create a table in JavaScript from an array...
But I want something a bit different than what I am getting below.
I want the ID to be 2 Rows high and on the far LEFT
I then want ObsID, SppBova, COMMON_NAME, Tier to be to the right of the ID but all on row 1
Then to the right of the ID and on the 2nd line I want GENUS, SPECIES, FedStatus, TaxaGrp
Can I modify the below to do this or is there an easier way? I need to do this in JS
var i;
var out = "<table id=t02>";
dojo.forEach(newarr, function (arr){
out += "<tr><td>" +
arr.id +
"</td><td>" +
arr.ObsID +
"</td><td>" +
arr.SppBova +
"</td><td>" +
arr.COMMON_NAME +
"</td><td>" +
arr.GENUS +
"</td><td>" +
arr.SPECIES +
"</td><td>" +
arr.Tier +
"</td><td>" +
arr.FedStatus +
"</td><td>" +
arr.TaxaGrp +
"</td></tr>";
});
out += "</table>";
document.getElementById("id02").innerHTML = out;
But I want something a bit different than what I am getting below.
I want the ID to be 2 Rows high and on the far LEFT
I then want ObsID, SppBova, COMMON_NAME, Tier to be to the right of the ID but all on row 1
Then to the right of the ID and on the 2nd line I want GENUS, SPECIES, FedStatus, TaxaGrp
Can I modify the below to do this or is there an easier way? I need to do this in JS
var i;
var out = "<table id=t02>";
dojo.forEach(newarr, function (arr){
out += "<tr><td>" +
arr.id +
"</td><td>" +
arr.ObsID +
"</td><td>" +
arr.SppBova +
"</td><td>" +
arr.COMMON_NAME +
"</td><td>" +
arr.GENUS +
"</td><td>" +
arr.SPECIES +
"</td><td>" +
arr.Tier +
"</td><td>" +
arr.FedStatus +
"</td><td>" +
arr.TaxaGrp +
"</td></tr>";
});
out += "</table>";
document.getElementById("id02").innerHTML = out;