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
Solved

scrolling list width

Posted on 2001-06-04
8
191 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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
Sort Order Icons on HTML Table 3 35
edit .asp files 5 31
How easy is it to support multiple logins to my website on one web browser session? 5 36
Html value of radio 14 28
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

860 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