下文所有内容转自开源中国:http://www.oschina.net/question/565065_86453#tags_nav

=============================================================================

ASP.NET中服务器控件Table动态生成表格

 1 Table tb = new Table();
 2 
 3 int row = 3;    // 行数
 4 int col = 4;    // 列数
 5 for(int i=0;i<row;i++)
 6 
 7 {
 8     TableRow tr = new TableRow();
 9     tb.Rows.Add(tr);
10 
11     for(int j=0;j<col;j++)
12 
13    {
14         TableCell td = new TableCell();
15         tr.Cells.Add(td);
16         td.Text = i.ToString();      
17     }  
18 } 
View Code

相关文章:

  • 2021-08-16
  • 2022-12-23
  • 2021-07-19
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-13
  • 2022-12-23
猜你喜欢
  • 2021-09-29
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2022-02-11
相关资源
相似解决方案