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
Jignesh TrivediPosted Dec 9, 2013, 1:25 AM
hi,
also try...
ro.Attributes.Add("style", "border:2px;border-color:red");
hope this will help you.
Jaganathan BantheswaranPosted Dec 8, 2013, 11:40 PM
Create a separate CSS class and apply like this,
HtmlTable tbl = new HtmlTable();
tbl.Attributes.Add("class","ClassName");