Solved

scrolling list width

Posted on 2001-06-04
8
177 Views
Last Modified: 2010-04-09
Hi,

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

Thanks
Mel
0
Comment
Question by:mruel
  • 4
  • 2
  • 2
8 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6153162
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6153187
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
 

Author Comment

by:mruel
ID: 6154021
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
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 100 total points
ID: 6154095
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:kneea
ID: 6155427
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
 

Author Comment

by:mruel
ID: 6155783
Ok, thanks both for your comments...

Mel
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6155798
Sorry there was no good solution, sometimes browsers are a real pain.  Thanks for the A. :^)

Cd&
0
 
LVL 2

Expert Comment

by:kneea
ID: 6155920
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now