static drop-down menu width

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • keydrive
    New Member
    • Oct 2007
    • 57

    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
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    It depends because we don't know what you are doing. Normally, it's just 'width:100px', but it depends.

    Comment

    • keydrive
      New Member
      • Oct 2007
      • 57

      #3
      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.

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        How to get a quicker, more complete answer. .

        Comment

        • keydrive
          New Member
          • Oct 2007
          • 57

          #5
          Code:
          <tr>
           <td>Selectbox 1 
              <select name="in">
             	<option value="all" 		  <%  if(in.equals("all")){ %>selected="yes"<% }%>>all</option>
          	<option value="only all" 	  <%  if(in.equals("onlyall")) { %>selected="yes"<% }%>>only all</option>
          	<option value="only all two" 	  <%  if(in.equals("onlyalltwo")) { %>selected="yes"<% }%>>only all two</option>
          	<option value="only all three" 	  <%  if(in.equals("onlyallthree")) { %>selected="yes"<% }%>>only all three</option>
          	<option value="only all four"     <%  if(in.equals("onlyallfour")) { %>selected="yes"<% }%>>only all four</option>
          	<option value="only all trust me" <%  if(in.equals("onlyalltrustme")) { %>selected="yes"<% }%>>only all trust me</option>
          			
               </select>
           </td>
          </tr>
          
          <tr>
           <td>Selectbox 2
              <select name="out">
             	<option value="all"	<%  if(out.equals("all")){ %>selected="yes"<% }%>>all></option>
          	<option value="out 1"   <%  if(out.equals("out1")) { %>selected="yes"<% }%>>out 1</option>
          	<option value="out 2.2" <%  if(out.equals("out2.2")) { %>selected="yes"<% }%>>out 2.2</option>
               </select>
            </td>
          </tr>
          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

          Comment

          Working...