Horje
show image inside table with innerhtml Code Example
show image inside table with innerhtml
var array = cvpls();
var table = ``;
for (var i = 0; i < array.length; i++) {
  table += `<tr>`;
  for (var j = 0; j < array[i].length; j++) {
    if (i === 1 && j === 2) {
      table += `<td><img src='http://imgh.us/statik.gif' style ='width:50px;height:50px'></td>`;
    } else {
      table += `<td>${array[i][j]}</td>`;
    }
  }
  table += `</tr>`;
  document.getElementById("Invtable").innerHTML = table;
}

function cvpls() {
  return array = [
    [4, 5, 6, 9, 2],
    ['img', 'img', 'img', 'img', 'img'],
    ['d', 'b', 'g', 'i', 'o']
  ];
}




Html

Related
double underline in html Code Example double underline in html Code Example
django template comments Code Example django template comments Code Example
HTML file path Code Example HTML file path Code Example
color ful scroll bar Code Example color ful scroll bar Code Example
how to remove the content of a html element Code Example how to remove the content of a html element Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12