Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lists with fixed size

Status
Not open for further replies.

hablablow

Programmer
Sep 9, 2000
115
FR
I don't know if it is possible to have a fixed size for lists wathever the size of
the words are in it. In other words i want to have a fixed size for lists.
By the way what happens if you have a longer word if the size is blocked ?
Thanks for your coming answers.
 
>is possible to have a fixed size for lists wathever the size of
> the words are in it.

No, HTML does not support that.

The only thing you can do is to limit the number of characters allowed into each list item, then also supply a (spacer) item that contains perhaps the '-' (dash) character repeated for the number of characters you allow in the items. So something like this.


<select ....>
<option value=&quot;0&quot;>----- Select One -----</option>
<option value=&quot;1&quot;>First Choice</option>
<option value=&quot;2&quot;>Second Choice</option>
</select>


Hope this helps
-pete
 
The way to achieve what you want is to use a table. Say your list's longest line is 300 pixels. Create a 300 pixel wide table where you want the list and create the list inside the table. That will keep it where you want it.

Once the list is in the table you can tweak the table size so it won't wrap.
 
is possible to have a fixed size for lists wathever the size of the words are in it.

Yes!

<select name=&quot;FieldName&quot; style=&quot;width:300px&quot;>

By the way what happens if you have a longer word if the size is blocked?

Unfortunately, anything longer than what you specify in your width will be chopped off. This whole technique will also not work in some lesser browsers such as Netscape. Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top