1. 页面上定义一个server 的table
<table style="width: 100%" id="tbContent" runat="server">
</table>
2. 后台
HtmlTableRow rowQy = new HtmlTableRow();
HtmlTableCell cellHeadQty = new HtmlTableCell();
cellHeadQty.Width = "60";
cellHeadQty.Align = "left";
cellHeadQty.InnerText = "Total Demand Qty";
rowQy.Cells.Add(cellHeadQty);
for (int i = 1; i < 13; i++)
{
HtmlTableCell cell = new HtmlTableCell();
TextBox tb = new TextBox();
tb.ID = "tbQty" + i.ToString();
tb.Width = 50;
cell.Align = "center";
cell.Controls.Add(tb);
rowQy.Cells.Add(cell);
}
tbContent.Rows.Add(rowQy);