By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,986 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,986 IT Pros & Developers. It's quick & easy.

THEAD in htmltable

P: n/a
I'm hoping someone might be able to help me with the following issue.

Basically I'm creating a htmltable on the fly and then simply
populating it with rows and cells accordingly. My test site has a
CSS sheet which applies styling etc. My problem is that I can't find
a method of adding a THEAD tag into the table. For example I start

HtmlTable td = new HtmlTable();
HtmlTableRow tblRow = new HtmlTableRow();
HtmlTableCell tc = new HtmlTableCell("th");

which give me something like

<TH ............ </TH>
Although I can get the CSS to target TH tags, I want to keep the whole
design normal, in that my rendered HTML contains

<TH ............ </TH>

Can anyone please help with this? I've googled for over an hour now
without any luck. I thought that literals might help e.g.

HtmlTableCell tc = new HtmlTableCell("th");
tc.Controls.Add(new LiteralControl("<THEAD>"));

however this renders the THEAD in the wrong place, ad you'd expect.

With this in mind I tried to add it to the tabletow e.g.

HtmlTableRow tblRow = new HtmlTableRow();
tblRow.Controls.Add(new LiteralControl("<THEAD>"));

But again this fails because it's not a child object.

Any help would be greatly appreciated.

Jan 31 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.