title: How to add textbox to each and every cell in a table row and let user add multiple rows?
body: <p>Following is my markup code: </p>
  
  <pre><code>&lt;asp:Table ID="tbldata"  runat="server" BorderWidth="2"&gt;
  &lt;asp:TableHeaderRow ID="tableheaderrow1" runat="server"&gt;
  &lt;asp:TableHeaderCell Width="80" runat="server"&gt;SNO&lt;/asp:TableHeaderCell&gt;
  &lt;asp:TableHeaderCell Width="200" runat="server"&gt;Particulars&lt;/asp:TableHeaderCell&gt;
  &lt;asp:TableHeaderCell Width="80" runat="server"&gt;Amount&lt;/asp:TableHeaderCell&gt;
  &lt;asp:TableHeaderCell Width="120" runat="server"&gt;Tax&lt;/asp:TableHeaderCell&gt;
  &lt;asp:TableHeaderCell Width="300" runat="server"&gt;OtherExpenditures&lt;/asp:TableHeaderCell&gt;
  &lt;asp:TableHeaderCell Width="80" runat="server"&gt;NetAmount&lt;/asp:TableHeaderCell&gt;
  &lt;/asp:TableHeaderRow&gt;
  &lt;/asp:Table&gt;
  </code></pre>
  
  <p>and following is my CS code</p>
  
  <pre><code>protected void txtCalendar_TextChanged(object sender, EventArgs e)
  {
      TextBox t = new TextBox();
      TableRow rowNew = new TableRow(); // Creating a new table row
      for (int i = 0; i &lt; 6; i++)
      {
          TableCell tcell = new TableCell();
          tcell.Controls.Add(t);         // add the textbox control at cell zero
          // or you can add it as
          rowNew.Controls.Add(tcell);
      }
      tbldata.Controls.Add(rowNew);
  }
  </code></pre>
  
  <p>I want to add textbox to every cell in a table row so that the user may enter data there, but with the above code, textbox is only added to the last cell. What should I do to add textbox to each and every cell? There are 5 header columns as indicated by markup above. I want to add textbox to each and every column.How can I do it? Also I want to include a button named Add Row which when clicked lets user add rows. How can I do this as well? </p>