473,387 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

static drop-down menu width

Hi,

To make multiple drop-down menus look synthetically pleasing on a form, how do you set a static width? The default behavior is to extend the width of the box to the longest character option. However, if a second, or third box contains less characters the box width sizes are different and messing looking.

Thanks
Apr 7 '08 #1
4 2760
drhowarddrfine
7,435 Expert 4TB
It depends because we don't know what you are doing. Normally, it's just 'width:100px', but it depends.
Apr 7 '08 #2
I have two drop-down menus on a form. Both have multiple options to select. Both drop-down menu options have different lengths because of the associated options.

menu option 1
Sun One
Sun Onethree
Sun OneThree Two

menu option 2
Sun 1
Sun 1.2
Sun 1.3.5

During viewing, menu option 1 is larger by a few characters and displays according to the largest hidden option. Where as, menu option 2 is slightly smaller.
Apr 8 '08 #3
Expand|Select|Wrap|Line Numbers
  1. <tr>
  2.  <td>Selectbox 1 
  3.     <select name="in">
  4.        <option value="all"           <%  if(in.equals("all")){ %>selected="yes"<% }%>>all</option>
  5.     <option value="only all"       <%  if(in.equals("onlyall")) { %>selected="yes"<% }%>>only all</option>
  6.     <option value="only all two"       <%  if(in.equals("onlyalltwo")) { %>selected="yes"<% }%>>only all two</option>
  7.     <option value="only all three"       <%  if(in.equals("onlyallthree")) { %>selected="yes"<% }%>>only all three</option>
  8.     <option value="only all four"     <%  if(in.equals("onlyallfour")) { %>selected="yes"<% }%>>only all four</option>
  9.     <option value="only all trust me" <%  if(in.equals("onlyalltrustme")) { %>selected="yes"<% }%>>only all trust me</option>
  10.  
  11.      </select>
  12.  </td>
  13. </tr>
  14.  
  15. <tr>
  16.  <td>Selectbox 2
  17.     <select name="out">
  18.        <option value="all"    <%  if(out.equals("all")){ %>selected="yes"<% }%>>all></option>
  19.     <option value="out 1"   <%  if(out.equals("out1")) { %>selected="yes"<% }%>>out 1</option>
  20.     <option value="out 2.2" <%  if(out.equals("out2.2")) { %>selected="yes"<% }%>>out 2.2</option>
  21.      </select>
  22.   </td>
  23. </tr>
  24.  
  25.  
Select box 1 appears with approx 17 char wide
Select box 2 appears with approx 7 char wide

Visually this looks messy and would like to have both select boxes be the same width. width="200px" does not work on the <tr> or <td>

Thanks
Apr 8 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: cppaddict | last post by:
I would like to write, within the private section of my class definition: static enum TruncType {TRUNC_TOP,TRUNC_RIGHT,TRUNC_BOTTOM,TRUNC_LEFT}; but C++ does not allow this. The four values...
1
by: Andrew Parker | last post by:
Hi, I'm having a syntax problem and hours of googling has yet to reveal a solution. I'm writing a class that contains only public static methods. It's a class of useful misc. functions that don't...
4
by: Rakesh Sinha | last post by:
I am having this code here. static const float PI = 3.14159; static const float INC = 0.4f * PI; When I compile my program, I get the following error, error: `MyClass::PI' cannot appear...
5
by: Gustavo Randich | last post by:
Hello, I need to know what's wrong in this translation from Informix. Note the difference in the results, which is due to the UPDATE statement. ORIGINAL PROGRAM (INFORMIX):...
7
by: sunil | last post by:
Hi, I am dealing with problem where I need virtual+static function: enum {A=0,B=1}; Factory.cpp: ------------------ Base * createInstance(int classType,char *name) { if(classType == A)
7
by: Brybot | last post by:
Apparently it is not possible for a static class to extend an abstract class? I was wondering how else I might be able to go about my problem here? I have a base class Parent which has a static...
12
by: chandu | last post by:
hello, i want to know usage of static methods in a class. is it advantageous or disadvantage to use more static methods in a class. thank u
6
by: Marvin Barley | last post by:
I have a class that throws exceptions in new initializer, and a static array of objects of this type. When something is wrong in initialization, CGI program crashes miserably. Debugging shows...
9
by: LamSoft | last post by:
Class B { public B() {} } Class A : B { public static string ABC = "myABC"; public A() {} }
6
by: Grey Alien | last post by:
class A { public: A(const B& ref); private: static B& b ; }; How may b be initialized ?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.