scrolling list width

Hi,

Does anybody knows how to specify a default size for a scrolling list (<select>)? I really need to do this!

Thanks
Mel
mruelAsked:
Who is Participating?
 
COBOLdinosaurCommented:
I am afraid you are caught be the technology.  What I done a few times when I want to widden is just stick in a dummy element at the end with a string of ===== It actually doesn't look to bad sort of like an end of list indicator. Other than that. Nothing helpful.

Cd&
0
 
COBOLdinosaurCommented:
The width of the select box is determined by the width of the largest
element.  You can't change that.  If you want it narrow reduce the length
of the longest line. If you want it wider add some additional characters to
the longest line.

Sorry but that is how the technology is designed

Cd&
 
0
 
COBOLdinosaurCommented:
Oops,
I assumed you were asking about width. If it is the height that is different
you can use <select size="10"> to define how many items will show by default.


Cd&
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
mruelAuthor Commented:
Yes, I was talking about width. You are sure there's no other way? I<m about to add a string of blank, but it<s tricky to maintain the list in the right order, because I add elements dynamically to the list...
0
 
kneeaCommented:
You could use java instead of javascript - there are lots of options with java and you can do almost what you want.  Lots of libraries already exist to do many things.

I've seen fixed width scroll boxes in windows on chat software and special search engines so it must be possible.

...but it can take a long time to do or to get working.

0
 
mruelAuthor Commented:
Ok, thanks both for your comments...

Mel
0
 
COBOLdinosaurCommented:
Sorry there was no good solution, sometimes browsers are a real pain.  Thanks for the A. :^)

Cd&
0
 
kneeaCommented:
What CD said works well, you can also think about using ----- instead and ===== separate the list into categories.  It is what a lot of the big sites use.

Another thing they do is to give the list a title and then add the ===== or the ---- underneath it.  This too looks quite smart.

You will need to catch the event or the selection though, just in case the user selects what is now an invalid choice.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.