title: Create radio button inside dynamic generated table
body: <p>I have this code in Ajax/Javascript where I am generating a dynamic table that should hold some returned value.
  At the beggining of each row I would like to have a column of radio buttons, that I could use to identify a particular row.
  How can I create radio buttons inside the table?
  Thanks</p>
  
  <p>Here is my code:</p>
  
  <pre><code>for (var i = 0; i &lt; controller_data.length; i++) {
      tr = $('&lt;tr/&gt;');
  
  
      // this is the row where the radio button should be
  
      tr.append("&lt;td&gt; &lt;input type="radio"&gt; &lt;/td&gt;");
      tr.append("&lt;td&gt;" + controller_data[i].id + "&lt;/td&gt;");
      tr.append("&lt;td&gt;" + controller_data[i].question + "&lt;/td&gt;");
      tr.append("&lt;td&gt;" + controller_data[i].image + "&lt;/td&gt;");
      tr.append("&lt;td&gt;" + controller_data[i].answer1 + "&lt;/td&gt;");
      tr.append("&lt;td&gt;" + controller_data[i].answer2 + "&lt;/td&gt;");
      tr.append("&lt;td&gt;" + controller_data[i].answer3 + "&lt;/td&gt;");
      tr.append("&lt;td&gt;" + controller_data[i].answer4 + "&lt;/td&gt;");
      $('table').append(tr);
  }
  </code></pre>