Width Dependencies

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Carey

    Width Dependencies

    Hi

    I'm developing an app that's translated into a number of different
    languages. A particular page contains a form with a couple of select
    boxes one on top of another. Because the form is quite complex I've
    used a table to describe its structure. My problem is in trying to
    align the select boxes correctly. Some select boxes might only be
    numeric, containing one or two characters. Other text based ones
    contain an arbitary number of characters depending on the language
    selected by the user. How can I tell each select box that it should be
    the same width as the widest select box? Any suggestions are much
    appreciated.

    Many thanks
    Paul


    What happens (each select box is in its own cell):

    8\/
    Indeterminate No Chars\/
    Letters\/

    What I'd like to happen:

    8 \/
    Indeterminate No Chars\/
    Letters \/
  • Felipe Gasper

    #2
    Re: Width Dependencies

    You could try using Javascript DOM to a) read the computed width of the
    widest select then b) set the CSS width of the other selects. Use
    document.defaul tView.getComput edStyle() (an example is at
    http://www.csie.ntu.edu.tw/~b7506051...examples7.html) to read
    the computed width, then plain ol' CSS DOM to assign the width.

    I don't know how well it'll work in IE, but I am 90% sure that there's an
    IE equivalent.

    Another idea might be to fix the width of the enclosing td and make each
    select 100% width. That avoids Javascript, which is generally a good idea.

    cheers,
    Felipe Gasper
    Urbana, IL USA

    On Wed, 25 Feb 2004, Paul Carey wrote:
    [color=blue]
    > I'm developing an app that's translated into a number of different
    > languages. A particular page contains a form with a couple of select
    > boxes one on top of another. Because the form is quite complex I've
    > used a table to describe its structure. My problem is in trying to
    > align the select boxes correctly. Some select boxes might only be
    > numeric, containing one or two characters. Other text based ones
    > contain an arbitary number of characters depending on the language
    > selected by the user. How can I tell each select box that it should be
    > the same width as the widest select box? Any suggestions are much
    > appreciated.[/color]

    Comment

    • Lauri Raittila

      #3
      Re: Width Dependencies

      In article Paul Carey wrote:[color=blue]
      > Hi
      >
      > How can I tell each select box that it should be
      > the same width as the widest select box? Any suggestions are much
      > appreciated.[/color]

      Give width:100% for all exept the widest input box?

      Supposing you have input in one table cell and label in other.
      [color=blue]
      > What happens (each select box is in its own cell):[/color]

      URL would be be nicer.

      --
      Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
      Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
      tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

      Comment

      Working...