html:select of struts

Hi experts ..

How can I change the aligment of values inside <html:select> of struts?? I want it right aligmnet!! but it doesn't have align or dir property!!
LVL 9
DrAskeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ECollinCommented:
hi,

u can use a css style like this :

<html:select style="text-align:right">
...


Emmanuel
0
DrAskeAuthor Commented:
It didn't work!!
       <html:select  size="5"  property="Dim" style="text-align:right">
            <html:optionsCollection  label="prompt" value="index" property="Dim.displayData"/>
        </html:select>
0
Mayank SAssociate Director - Product EngineeringCommented:
Try putting it in a <td> of a table

<td align = "right"><html:select>....</html:select></td>
0
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

DrAskeAuthor Commented:
It didn't work too!!
0
Mayank SAssociate Director - Product EngineeringCommented:
How did you do it with the table?
0
DrAskeAuthor Commented:
<table cellspacing="2" cellpadding="3" border="1" width="100%">
        <tr>
          <td align="right">
            <html:select size="5" property="Dim">
              <html:optionsCollection label="prompt" value="index" property="Dim.displayData"/>
            </html:select>
          </td>
          <td>
            <html:image src="anim_down.jpg" property="nomembers" value="nomembers" onclick="event.value=this.value;btn1.value=this.value;"/>
            <html:image src="build_down.jpg" property="nobuildings" value="nobuildings" onclick="event.value='nomembers';btn1.value=this.value; "/>&nbsp;
          </td>
          <td>&nbsp;</td>
        </tr>
      </table>
0
Mayank SAssociate Director - Product EngineeringCommented:
You have a td after that one too, so how would this be right aligned?
0
Mayank SAssociate Director - Product EngineeringCommented:
<table cellspacing="2" cellpadding="3" border="1" width="100%">
        <tr>
          <td width = "50%">
            <html:image src="anim_down.jpg" property="nomembers" value="nomembers" onclick="event.value=this.value;btn1.value=this.value;"/>
            <html:image src="build_down.jpg" property="nobuildings" value="nobuildings" onclick="event.value='nomembers';btn1.value=this.value; "/>&nbsp;
          </td>
          <td>&nbsp;</td>
          <td width = "50%" align="right">
            <html:select size="5" property="Dim">
              <html:optionsCollection label="prompt" value="index" property="Dim.displayData"/>
            </html:select>
          </td>
        </tr>
      </table>

   

0
DrAskeAuthor Commented:
okay !! it seems that you did not read my quesion carefully :o) ..

I want the text values in the select list to be right aligment not the list it self!!
0
Mayank SAssociate Director - Product EngineeringCommented:
Oops, in that case the td will not work
0
ECollinCommented:
hi,

i'm a bit surprised that my code doesn't work. I tested it with success.

You can also try to embed css styles in your page like this :
select {
text-align:right;
}


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DrAskeAuthor Commented:
Really don't know why it doesn't work !!
I'm using JDeveloper, I have a view object with set of attributes, in the data control palette I've selected the *Dim* attribute -as you can see in the *property* attribute in html:select- and specify it to be * List of Values* from the combobox and drag/drop it inside the jsp page???

 <html:select size="11" property="Dim" style="text-align:right;;width:250px;">
          <html:optionsCollection style="text-align:right;" label="prompt" value="index" property="Dim.displayData"/>
        </html:select>
0
DrAskeAuthor Commented:
May be it doesn't work because it is *Struts html*??
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.