Label text-align to center?

mRbLACK

Freshman
Joined
Aug 27, 2003
Messages
25
Location
south africa
OK this is such a small thing why is it so hard!!

an ASp:label control how can i center align the text from the .vb code...

if you do it on the control itself its easy..

Code:
 <asP:label style='text-align:center;' blablabla />

sorted its works fine but as soon as i try do it from code it doesnt work? does any one know how to do this?

have tried alot of ways...
Code:
lblError.Style("text-align") = "center"
lblError.Style("textalign") = "center"
lblError.Style("align") = "center"


once again...HEEELP!! :D
 
nope doesnt work, im not sure if maybe asp tags have different attribute names or something? its very odd because it works if you dont dont do it programatically?
 
THis is html, when an label is being aligned, its being aligned relative to what?, its parent <p>? if that is the case, then you need to put the align in the <p> or <td>
 
Have you tried using Attributes.Add in this manner?

Visual Basic:
lblError.Attributes.Add("style", "text-align:center;")
 
Back
Top