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.defaultView.getComputedStyle() (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:
Quote:
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. |