Drop-Down List Justification?

  • Thread starter Thread starter George
  • Start date Start date
G

George

VS.NET 2002/VB

Is there any way to right justify the items in a drop-down list?

I have a list of fractions -- in 1/8 and 1/16 -- and they look kind of funky being left justified,
especially since the 16's get wider and wider as you go down the list.

I've tried padding the 1/8s with spaces to move them over a little, but spaces don't seem to hold in
a list.

Thanks,
George
 
Hi, George,

For simple cases like list of numbers you can set the css property
"direction" to "rtl" (right to left). A side effect is that the dropdown
button goes to the left end of the control which may surprise or even
frighten users. Anyway, try experimenting with it.

<asp:dropdownlist id="dropDownList1" runat="server"
style="direction:rtl;"/>

If there is enough space in the page and the items are not that many I'd
rather use RadioButtonList with RepeatLayout table, RepeatDirection vertical
and TextAlign right.

Greetings
Martin
 
Martin,

I really didn't think there was any way to do it, so I'll play around with your suggestion a little.

Thanks,
George
 
Back
Top