?
Solved

html:select of struts

Posted on 2007-03-28
13
Medium Priority
?
1,273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Mayank S
ID: 18809301
Try putting it in a <td> of a table

<td align = "right"><html:select>....</html:select></td>
0
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 
LVL 9

Author Comment

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

Expert Comment

by:Mayank S
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
 
LVL 30

Expert Comment

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

Expert Comment

by:Mayank S
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:Mayank S
ID: 18809515
Oops, in that case the td will not work
0
 
LVL 10

Accepted Solution

by:
ECollin earned 2000 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Suggested Courses

801 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