Table 控件是要 先添加行,然后再在这一行里,添加单元格,也就是列。。因为 Table 不要求每一行的列数都相同的。所以每一行要自己单独再添加列下面的MSDN提供的示例代码:protected void Button1_Click (object sender, System.EventArgs e){// Total number of rows.int rowCnt;// Current row count.int rowCtr;// Total number of cells per row (columns).int cellCtr;// Current cell counterint cellCnt;rowCnt = int.Parse(TextBox1.Text);cellCnt = int.Parse(TextBox2.Text);for(rowCtr=1; rowCtr <= rowCnt; rowCtr++) {// Create new row and add it to the table.TableRow tRow = new TableRow();Table1.Rows.Add(tRow);for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++) {// Create a new cell and add it to the row.TableCell tCell = new TableCell();tCell.Text = "Row " + rowCtr + ", Cell " + cellCtr;tRow.Cells.Add(tCell);}}}