title: Javascript change the src of a table cell
body: <p>I am trying to change content of the first cells of rows into some images. Below is my Javascript code which doesn't work. I tried to use <code>p.appendChild(img)</code>, but as it's in a for loop, each time I pressed the button that invokes this, it will append another image to that row. I reckon that I am not using <code>.src</code> correctly? Can someone please help? </p>
  
  <pre><code>    var rowx =document.getElementById(rowid); //the row that I want to change its first cell
      var uri= "baseuri"+rowid;
      img = document.createElement('img');
      img.src= uri;
      var p = rowx.cells[0];
      p.src=img; //this doesn't change the first cell's content.if I use p.appendChild(img) it will append new img each time it gets executed. 
  </code></pre>