Solved

html:select of struts

Posted on 2007-03-28
13
1,258 Views
Last Modified: 2013-11-24
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!!
0
Comment
Question by:DrAske
  • 6
  • 5
  • 2
13 Comments
 
LVL 10

Expert Comment

by:ECollin
ID: 18809135
hi,

u can use a css style like this :

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


Emmanuel
0
 
LVL 9

Author Comment

by:DrAske
ID: 18809220
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
 
LVL 30

Expert Comment

by:mayankeagle
ID: 18809301
Try putting it in a <td> of a table

<td align = "right"><html:select>....</html:select></td>
0
 
LVL 9

Author Comment

by:DrAske
ID: 18809345
It didn't work too!!
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 18809361
How did you do it with the table?
0
 
LVL 9

Author Comment

by:DrAske
ID: 18809409
<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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 30

Expert Comment

by:mayankeagle
ID: 18809437
You have a td after that one too, so how would this be right aligned?
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 18809445
<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
 
LVL 9

Author Comment

by:DrAske
ID: 18809496
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
 
LVL 30

Expert Comment

by:mayankeagle
ID: 18809515
Oops, in that case the td will not work
0
 
LVL 10

Accepted Solution

by:
ECollin earned 500 total points
ID: 18815017
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
 
LVL 9

Author Comment

by:DrAske
ID: 18831274
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
 
LVL 9

Author Comment

by:DrAske
ID: 18831282
May be it doesn't work because it is *Struts html*??
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now