| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Subscribe to WebmasterWorld|
|Select list widths|
| 3:29 pm on Feb 13, 2011 (gmt 0)|
I'm trying to specify a fixed width for the initial select list display field irrespective of the lengths of the option values it contains.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<td align='left' width='150'>
<option value='b'>Very Long</option>
The option value length is specified earlier on in the application with maxlength on the input to ensure its width is no longer than the space available with width='150'.
The select list above will be the width of Very Long and the width of 150 is more than that.
My question is how can I control the width of the display irrespective of how long Very Long is.
A prefect example is yahoo email, inbox displays your emails and you've got buttons to delete and spam and select lists for mark as and move to.
The select lists mark as and move to have an initial select list display field which is shorter than the lengths of the option values it contains.
mark as has Mark as the text display with a width of about 50px for the <td> but when you click it the first option is Mark as Unread which is clearly longer than Mark.
How do they do that then?
Thanks for any help in advance.
| 6:51 pm on Feb 13, 2011 (gmt 0)|
If I understand the question correctly, simply specify the maximum width of the select list, as the width of the table cell won't control the width of the selection list.
<select style="position: relative; width: 100px">
| 9:28 am on Feb 14, 2011 (gmt 0)|
Perfect, exactly what I was after. Thanks.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2014 all rights reserved