Solved

scrolling list width

Posted on 2001-06-04
8
167 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 2

Expert Comment

by:kneea
Comment Utility
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
Comment Utility
Ok, thanks both for your comments...

Mel
0
 
LVL 53

Expert Comment

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

Cd&
0
 
LVL 2

Expert Comment

by:kneea
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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 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 …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

772 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

10 Experts available now in Live!

Get 1:1 Help Now