I have to display some information like this example :
Name : myname
But what I get is like this :
Name :
myname
I think when I use insertRow in javascript I create a new row ! but I like to insert a new column in an existing table . Can any one help me please to get this display?
function Donnee() {
$.ajax({
url: "/MyUrl",
type: "GET",
dataType: "xml",
success: function(xml) {
$(xml).find('occurrences').each(function() {
var row = document.getElementById("row-nom");
var cell1 = document.getElementById("cell-nom");
if (row === null) {
var row = table.insertRow(3);
row.id = "row-nom";
}
if (cell1 === null) {
var cell1 = row.insertCell(0);
cell1.id = "cell-nom";
}
$(this).find("occurrence").each(function() {
datasection = $(this).attr('datasection');
if (datas == "mytable") {
$(this).find("data").each(function() {
var item = $(this).find('item').text();
var value = $(this).find('value').text();
if (item == "NMPRES") {
NMPRES = $(this).find('value').text();
}
});
cell1.innerHTML = NMPRES;
}
});
});
}
});
}
<html>
<table id="Table">
<tr>
<td>
<div> personal info </div>
</td>
</tr>
<div>
<tr>
<td> Name </td>
<tr>
</div>
</html>
` tag into your code, but it insert `tr` (table row) tag into specified position. And also, https://www.youtube.com/watch?v=seKLsHOkN1U – degr Oct 12 '17 at 08:38