惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
The Cloudflare Blog
小众软件
小众软件
MyScale Blog
MyScale Blog
IT之家
IT之家
H
Help Net Security
宝玉的分享
宝玉的分享
V
Visual Studio Blog
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
博客园_首页
S
SegmentFault 最新的问题
MongoDB | Blog
MongoDB | Blog
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
Microsoft Security Blog
Microsoft Security Blog
Know Your Adversary
Know Your Adversary
Project Zero
Project Zero
P
Palo Alto Networks Blog
博客园 - 聂微东
罗磊的独立博客
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Engineering at Meta
Engineering at Meta
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
U
Unit 42
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
Cisco Talos Blog
Cisco Talos Blog
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyberwarzone
Cyberwarzone
G
Google Developers Blog
C
Cybersecurity and Infrastructure Security Agency CISA
大猫的无限游戏
大猫的无限游戏
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
T
Tailwind CSS Blog
雷峰网
雷峰网
C
Cisco Blogs

博客园 - 豆丁不想长大

CheckBoxList与表的操作 - 豆丁不想长大 - 博客园 判断用户浏览器类型的代码 - 豆丁不想长大 - 博客园 GridView的RowdataBound事件 javascript循环判断Radio是否选中 - 豆丁不想长大 - 博客园 不错的韩剧 19根烟忘却你的理由 28句朴素的道白 Web.config详解 - 豆丁不想长大 - 博客园 忘记密码发送邮件提醒的代码 弹出对话框后转到下一页的代码 后台编写返回上一页的代码 Gridview中的DataKeys問題 FindControl的作用 ASP.net2.0学习资料汇总 星巴克咖啡价格 ASP.NET 常用代码 MessageBox的CS文件中的写法 Split的用法 关于DDL控件提交后刷新问题
后台代码创建Table
豆丁不想长大 · 2007-11-09 · via 博客园 - 豆丁不想长大

Posted on 2007-11-09 08:42  豆丁不想长大  阅读(1332)  评论()    收藏  举报

 private void CreateTable(int rownum)
    {
        for (int i = 0; i <=rownum; i++)
        {
            TableRow mytablerow = new TableRow();
            TableCell mycell1 = new TableCell();
            TableCell mycell2 = new TableCell();
            if (i ==0)
            {
                mycell1.Text = "Selection";
                mycell2.Text = "Show (Maximum 40 characters)";
                mycell2.HorizontalAlign = HorizontalAlign.Center;
            }
            else
            {
                mycell1.Text=i.ToString();
                TextBox mytexbox1 = new TextBox();
                mytexbox1.CssClass = "b";
                mycell2.HorizontalAlign = HorizontalAlign.Left;
                mycell2.Controls.Add(mytexbox1);
                mytexbox1.ID = "mytexbox" + i.ToString();
                mycell2.VerticalAlign = VerticalAlign.Bottom;
            }
           
            mycell1.BackColor = Color.White;
            mycell1.BorderColor = Color.Black;
            mycell1.HorizontalAlign = HorizontalAlign.Center;
            mytablerow.Cells.Add(mycell1);
           
            mycell2.ColumnSpan = 3;
            mycell2.BackColor = Color.White;
            mycell2.BorderColor = Color.Black;
            mytablerow.Cells.Add(mycell2);
     
            Table2.Rows.Add(mytablerow);
        }
    }