tags:

views:

37

answers:

2

I'm dynamically building a .NET Table, including TableRows with TablesSection set, resulting in 1 THEAD row and multiple TBODY rows. Now I need to get the TableCells in the THEAD row to render with TH tags rather than TD tags. How do I do that? I haven't found a TableCell attribute for that, and it won let me add Literals to the row Cells collection.

A: 

You can use HtmlGenericControl th = new HtmlGenericControl("th") and add that to the thead row.

derek
How do I add it to the row? Using row.Cells.Add(mycell) gives a compile-time error, and row.Controls.Add(mycell) gives a run-time error.
Ken Paul
+1  A: 

Have you tried TableHeaderCell?

Alex
Now my forehead is sore from slapping it. Many thanks.
Ken Paul