自定义Table

        今天做一个通过解析XML文件,进行页面显示的功能。真是郁闷死了,我太菜了,可怎么办~

        但是也学到了东西,先将例子整理一下,以便以后用,嘿嘿。

 

            TableRow tr = new TableRow(); //tr
            TableCell tdName = new TableCell(); //td
            TableCell tdControl = new TableCell();   //td
            TextBox txtValue = new TextBox();  //TextBox
            tdName.Text = groupItem.Key; 
            tdControl.Controls.Add(txtValue);  //把textbox的值赋给td
            tr.Cells.Add(tdName);  //把td赋给tr
            tr.Cells.Add(tdControl);
            tbCustom.Rows.Add(tr); //把tr赋给table,该table在html中先定义出来。

你可能感兴趣的:(C#,table,textbox,html,xml)