HtmlTable control css class

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!
 
J

Jeffrey Palermo [MCP]

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
 
A

Alfred Salton

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top