HtmlTable control css class

  • Thread starter Thread starter Alfred Salton
  • Start date Start date
A

Alfred Salton

Can anyone show me how to set the css class of an HtmlTable control in
code on the server?

I can't find any indication that the css class is a property of the
HtmlTable, HtmlTableRow and HtmlTableCell classes. I'm getting the
uncomfortable feeling that this can't be done, even though it seems
incredible to me!
 
Alfred,
Any time you want to add any attribute that may not be included in the
code, just use HtmlTable.Attributes["class"] = "myCSSClass";
This will work for any attribute.

Best regards,
Jeffrey Palermo
 
Thanks Jeffrey, this works just fine. It is perhaps worth noting that
Attributes["class"] = "myCSSClass" uses C# syntax. VB is
Attributes("class") = "myCSSClass". This trips me up regularly - I much
prefer C# syntax, but am sometimes forced to use VB.
Alfred,
Any time you want to add any attribute that may not be included in the
code, just use HtmlTable.Attributes["class"] = "myCSSClass";
This will work for any attribute.

Best regards,
Jeffrey Palermo

Alfred Salton said:
Can anyone show me how to set the css class of an HtmlTable control in
code on the server?

I can't find any indication that the css class is a property of the
HtmlTable, HtmlTableRow and HtmlTableCell classes. I'm getting the
uncomfortable feeling that this can't be done, even though it seems
incredible to me!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top