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
Solved

html:select of struts

Posted on 2007-03-28
13
1,266 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:Mayank S
ID: 18809301
Try putting it in a <td> of a table

<td align = "right"><html:select>....</html:select></td>
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
countHi challenge 25 143
mapAB Challlenge 35 156
How can I   ajax html table  rows? 20 78
throw exception 21 58
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 …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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.

840 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