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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option length

Status
Not open for further replies.

atferraz

Technical User
Aug 23, 2003
129
PT
How to level the length of all options in a select element if the text for each options has different size?.

Thanks
 
You can set the width using css. Just make sure that it's wide enough to hold the option with the most text:

select {width: 200px}
 


>> You can set the width using css. Just make sure that it's wide enough to hold the option with the most text:

What is the point or making the select box wide enought to hold all the text? Select boxes are automatically adjusted to be the length of the maximum option.

Dan
 
BillyRayPreachersSon,
If you had several SELECT boxes in a form along with other INPUT types then being able to set the width is very useful to keep them all lined up nicely.

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 

I don't disagree with you.

I was referrring to the post of tnsbuff, and his specific statement, not the post of atferraz.

This is why I copied tnsbuff's post in my reply. I guess it wasn't enough to stop you being confused, so apologies for confusing you.

Dan
 
I was assuming they had more than one select statement, otherwise there would be no problem, and thus, they wouldn't have posted the question here in the first place.

I have personally had a form that had about 8 select statements in a column, all with different lengths and it was very handy to be able to specify the width using css so that they looked uniform.

BillyRayPreachersSon, I don't know why you have a problem with my post, other than you didn't think about what the original poster really meant by their question. I doubt that your response helped anyone, so quit wasting bandwidth.
 

Sorry if I offended anyone - it was never the intention.

The original post only ever referred to one select element, and the options within it.

I possibly misunderstood your initial post, tnsbuff. I don't "have a problem" with it. I simply couldn't understand your comment about making the width: property wide enough to hold the most text, when a single select box does this automatically, anyway.

I don't think my comments were at all wasting bandwidth - surely it is up to us to present as many factors as possible to the original poster, and let them decide what they do with what information?

Dan
 
BillyRay said:
What is the point or making the select box wide enought to hold all the text? Select boxes are automatically adjusted to be the length of the maximum option.

tnsbuff, I never saw mention of "multiple select boxes" in the intial post of the thread (nor in any post from afterraz). You drew that conclusion yourself.

The way I read that (in context) is that Dan is asking a perfectly legitimate question (and following it up with his direction of thought). Don't get so jumpy - not everyone is out to get you.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top