Solved

scrolling list width

Posted on 2001-06-04
8
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
multiple selects 23 62
Date on a table 16 34
HTML question 2 24
CSS - how to make button/link change to black on hover? 2 16
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 …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

756 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