Dynamically add rows to columns
<p>I am adding rows dynamically to a table. The table already has a row consisting of column headers like date, day etc.</p>

<pre><code>for(var i=0; i&lt;=fix;i++){
var cols = 5;
var tr = $('&lt;tr&gt;');
$('&lt;td name=Date"+i+" id=Date_"+i+"&gt;&lt;/td&gt;').appendTo(tr);
$('&lt;td id=day_"+ i+"&gt;"+theday +"&lt;/td&gt;').appendTo(tr);
for (var c = 0; c &lt; cols; c++){
$('&lt;td&gt; &lt;input type=text name=value_"+i+" id=value"+i+"&gt;&lt;/td&gt;').appendTo(tr);
      }
tr.appendTo($('#tbl&gt; tbody:first'))
}
</code></pre>

<p>I want to fill the 'td's with some vlaues stored in variable. But if i write</p>

<pre><code>$('&lt;td name=Date"+i+" id=Date_"+i+"&gt;"+var+"&lt;/td&gt;').appendTo(tr);
</code></pre>

<p>where var is a variable, Its value does not appear. Instead the whole string is displayed. How can i prefill then with some variable values ?</p>
