Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: listbox alignment


Message #1 by Dimitriy Dribinskiy <DimitriyD@M...> on Tue, 4 Sep 2001 15:03:44 -0400
Thanks for the script George.  It is a shame you can't right justify
this either.

Jeffrey Langdon
LTA Group, Inc
Web Programmer
100 Middlesex Center Blvd
Jamesburg, NJ 08831

-----Original Message-----
From: George Smyth [mailto:george.smyth@U...]
Sent: Wednesday, September 19, 2001 4:30 PM
To: javascript
Subject: [javascript] RE: listbox alignment


I don't believe that you can format information within a Select box.

BTW, here's another way of doing the <option> area:

       <select name=3D"start">
         <script language=3D"JavaScript">
  for (i =3D 0; i < 24; i++) {
   display =3D i;
   if (display > 11) { display -=3D 12 }
   if (display =3D=3D 0) { display =3D  12 }
   if (i < 12) {
    display +=3D ":00 am";
   } else {
    display +=3D ":00 pm";
   }
   document.write ("<option>" + display + "</option>");
  }
  </script>
 </select>

Cheers -

George L Smyth, Webmaster
U.S. Naval Academy Alumni Association

 -----Original Message-----
From:  Langdon, Jeffrey [mailto:jlangdon@L...]
Sent: Monday, September 17, 2001 4:38 PM
To: javascript
Subject: [javascript] RE: listbox alignment

Hello All:

I recently had a need for this posting.  The solutions posted to this
thread did not work for me.  Furthermore, I looked for an alignment
attribute for the options tag within a list box and there isn't one.  I
would like the time within the option tag to be right justified. Any
suggestions? Code Below.

TIA,

Jeffrey Langdon
LTA Group, Inc
Web Programmer
100 Middlesex Center Blvd
Jamesburg, NJ 08831

<form name=3D"time">
  <tr>
    <td align=3D"right">Start Time</td>
    <td align=3D"left">
       <select name=3D"start">
         <option>12:00 am</option>
    <option> 1:00 am</option>
    <option> 2:00 am</option>
    <option> 3:00 am</option>
    <option> 4:00 am</option>
    <option> 5:00 am</option>
    <option> 6:00 am</option>
    <option> 7:00 am</option>
    <option> 8:00 am</option>
    <option> 9:00 am</option>
    <option>10:00 am</option>
    <option>11:00 am</option>
    <option>12:00 pm</option>
    <option> 1:00 pm</option>
    <option> 2:00 pm</option>
    <option> 3:00 pm</option>
    <option> 4:00 pm</option>
    <option> 5:00 pm</option>
    <option> 6:00 pm</option>
    <option> 7:00 pm</option>
    <option> 8:00 pm</option>
    <option> 9:00 pm</option>
    <option>10:00 pm</option>
    <option>11:00 pm</option>
  </select>
 </td>
</form>



-----Original Message-----
From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]
Sent: Wednesday, September 05, 2001 6:16 AM
To: javascript
Subject: [javascript] RE: listbox alignment


yes, by using CSS

<SELECT STYLE=3D"align:right">

-----Original Message-----
From: Dimitriy Dribinskiy [mailto:DimitriyD@M...]
Sent: 04 September 2001 20:04
To: javascript
Subject: [javascript] listbox alignment


Hello
Is it possible to align text in a listbox to the right (center)?
Tanks

  Return to Index