Last post Dec 08, 2013 11:44 AM by smirnov
Dec 08, 2013 07:47 AM|thunderxlight|LINK
hi guys , how are you ? I hope you all fine ..
iam creating html table from c# code by using these tow classes
ro = new
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
Dec 08, 2013 11:44 AM|smirnov|LINK
ro.Style.Add("border", "100px"); ro.Style.Add("border-width", "100px"); ro.Style.Add("border-color", "red"); ro.Style["border"] = "100px";
This is wrong.
What is supposed to be shown when border=100px or border-width=100px? If you mean you want to set a width of the table row, then you need to use width not border.
See more about border here http://www.w3schools.com/css/css_border.asp. It has examples as well as explains tha border-width does not work if it is used alone.