Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Right align Select Box

Status
Not open for further replies.

ecobb

Programmer
Dec 5, 2002
2,190
US
I have a select box that shows the month and year (January 2003, February 2003, etc...). Is there any way to make the text in the select box right aligned so that all of the years are in line with each other?


Hope This Helps!

Ecobb
- I hate computers!
 
There's not really a good way that I know of, especially since IE doesn't support text-align for selects. You can however specify in the style for the select "font-family: monospaced", then add some &nbsp's to the beginning of the list items so they line up with the longest item.
Code:
 <select ><option value=&quot;One&quot;>&nbsp&nbspOne</option>
 <option value=&quot;Two&quot;>&nbsp&nbspTwo</option>
 <option value=&quot;Three&quot;>Three</option>
 </select>

Kevin
A+, Network+, MCP
 
Use a monospaced font and a date format such as this:

Jan 2003
Feb 2003
Mar 2003
Apr 2003
May 2003

Then there's no problem and everything lines up.

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top