hi guys , how are you ? I hope you all fine ..
here
iam creating html table from c# code by using these tow classes
HtmlTableRow ro = new HtmlTableRow ();
HtmlTableCell ce = new HtmlTableCell();
and now I,m trying to access the css style for this table to add border style and color etc...
I tried this
ro.Style.Add("border", "100px");
ro.Style.Add("border-width", "100px");
ro.Style.Add("border-color", "red");
ro.Style["border"] = "100px";
but they all doesn't work , I really don't know why
((maybe)) because there is no element in html file for the table and I created it all from c# code , because when t i try to access any element in html
I just add runatserver = true then i can access to it ..
I hope you guys can help me
thanks

Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Dec 8, 2013, 6:40 PM EST
Create a separate CSS class and apply like this,
HtmlTable tbl = new HtmlTable();
tbl.Attributes.Add("class","ClassName");
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 8, 2013, 8:25 PM EST
hi,
also try...
ro.Attributes.Add("style", "border:2px;border-color:red");
hope this will help you.