THEAD in htmltable

  • Thread starter Thread starter redaudi
  • Start date Start date
R

redaudi

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
with

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

which give me something like

<TR>
<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

<THEAD>
<TR>
<TH ............ > </TH>
</THEAD>

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.
 
Back
Top