zoukankan      html  css  js  c++  java
  • 动态创建表格,行,列, 选择框,非常经典!!!

     if (this.TextBox1.Text.Trim() != "")
            {
                int len = int.Parse(this.TextBox1.Text.Trim());
                for (int i = 0; i < len; i++)
                {
                    TableCell tc = new TableCell();
                    TableCell tc2 = new TableCell();
                    TextBox txt = new TextBox();
                    txt.ID = "txt" + i.ToString();
                    LiteralControl lc = new LiteralControl("<input id='Button2' type='button' value='button' onclick=javascript:fun('"+txt.ID+"') />");
                    tc.Controls.Add(txt);
                    tc2.Controls.Add(lc);
                    TableRow tr = new TableRow();
                    tr.Cells.Add(tc);
                    tr.Cells.Add(tc2);
                    this.Table1.Rows.Add(tr);
                }
            }
  • 相关阅读:
    [USACO 5.5]Hidden Password
    [Codeforces 1016F]Road Projects
    再会,OI
    [TJOI 2018]智力竞赛
    [POI 2009]Lyz
    [NOI 2015]品酒大会
    [NOI 2017]蔬菜
    [NOI 2017]整数
    [NOI 2017]游戏
    [NOI 2017]蚯蚓排队
  • 原文地址:https://www.cnblogs.com/MySpace/p/1599769.html
Copyright © 2011-2022 走看看