HighDots Forums  

Width Dependencies

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Width Dependencies in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Width Dependencies - 02-25-2004 , 10:46 AM






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 \/

Reply With Quote
  #2  
Old   
Felipe Gasper
 
Posts: n/a

Default Re: Width Dependencies - 02-25-2004 , 01:46 PM






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.

Reply With Quote
  #3  
Old   
Lauri Raittila
 
Posts: n/a

Default Re: Width Dependencies - 02-26-2004 , 11:16 AM



In article Paul Carey wrote:
Quote:
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.
Give width:100% for all exept the widest input box?

Supposing you have input in one table cell and label in other.

Quote:
What happens (each select box is in its own cell):
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.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.