Merge Cells in Table Control

Hello,

I'm creating Table (With rows and cells) dynamically in a web custom control like this:

Table Tab = new Table();
TableRow Row1 = new TableRow();
TableCell Cella = new TableCell();
TableCell Cellb = new TableCell();
Cella.Controls.Add(TextBox1);
Cellb.Controls.Add(TextBox2);
Row1.Controls.Add(Cella);
Row1.Controls.Add(Cellb);                  
Tab.Controls.Add(Row1) ;
Controls.Add(Tab) ;

How can I merge the two cells in the row?

Thanks
Praveen
praveenuniAsked:
Who is Participating?
 
nouloukCommented:
Hi, you can use:
Cella.ColumnSpan=2

Hope this helps.
0
 
raterusCommented:
Also ensure that you aren't adding the second cell if you use columnspan.
0
 
praveenuniAuthor Commented:
Thank you that helped!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.