chadmichael Posted December 20, 2005 Share Posted December 20, 2005 I need to make a select box stay to a certain width. More importantly, I'd like to keep the text of the options formatted to a certain width. Do I just need to insert non-breaking spaces? This seems kind of hackish. Any ideas? Seems basic. Link to comment Share on other sites More sharing options...
aspnetguy Posted December 20, 2005 Share Posted December 20, 2005 <select style="width:###px"><option value="0">000</select> Link to comment Share on other sites More sharing options...
chadmichael Posted December 20, 2005 Author Share Posted December 20, 2005 <select style="width:###px"><option value="0">000</select><{POST_SNAPBACK}> Thanks! That works great. Actually, I was just overlooking that because of the struts HTML-EL tag has a styleClass attribute instead of class. BUT . . . the bigger problem is preserving the space in the option text. I have headers above the select box at fixed widths. Now I need to make the items of data within the option text stay a fixed width apart??? I tried to use pre tags inside the option but they don't seem to work there. Link to comment Share on other sites More sharing options...
aspnetguy Posted December 20, 2005 Share Posted December 20, 2005 items of data within the option text stay a fixed width apartI'm not understanding your question Link to comment Share on other sites More sharing options...
chadmichael Posted December 20, 2005 Author Share Posted December 20, 2005 I'm not understanding your question<{POST_SNAPBACK}> The options in the select box have several "pieces" of data. Such as first name, last name, gender, etc. Above the select box are headings, such as First Name, Last Name, Gender. These items are controlled through layout and style sheets. But I need the pieces in the options to line up under the appropriate headings. The option tags look something like this<option value="1">Chad Michael Male</option><option value="2">Elvis Costello Male</option><option value="3">Jennifer Aniston-Pitt Female</option><option value="4">Mark Mothersbaugh Male</option>Of course, while my headings, in table cells, are controllable, the text of these optoin bodies collapses. Again, 's could do the trick but that seems to be bad style. Maybe I'm just using the select box in ways it isn't meant to be used. Is there a better solution?Chad Link to comment Share on other sites More sharing options...
aspnetguy Posted December 20, 2005 Share Posted December 20, 2005 I think it is safe to say that is your only option here. Select box options were only meant to hold one piece of data.I can't think of any other way of doing that easier that would make sense.Sorry Link to comment Share on other sites More sharing options...
chadmichael Posted December 20, 2005 Author Share Posted December 20, 2005 I think it is safe to say that is your only option here. Select box options were only meant to hold one piece of data.I can't think of any other way of doing that easier that would make sense.Sorry<{POST_SNAPBACK}> I appreciate your help.Chad Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now