473,574 Members | 2,941 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with option tag alignment

118 New Member

i am using the select box consits the option items in option tag .I have displayed the two items in option tag.i,e product name is to align left and product price is to align right .How can apply css to this feature.

I used like this
Expand|Select|Wrap|Line Numbers
  1. <option value="">Product name &nbsp;&nbsp;&nbsp;product price</option> 
But in case long length product names,short length product names it will not align properly. If any body please help me.Its very urgent.

Aug 10 '09 #1
5 5442
8,658 Recognized Expert Moderator Expert
you could try to float (CSS) the price right (<span> should be OK)
Aug 10 '09 #2
118 New Member

Thank you for your reply.But span tag is not working inside option tag.Please suggest other ways.

Aug 10 '09 #3
8,658 Recognized Expert Moderator Expert
well, this is working for me…
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
  4.     <head>
  5.         <meta http-equiv="content-type" content="application/xhtml+xml;charset=utf-8" />
  6.         <meta http-equiv="content-style-type" content="text/css" />
  7.         <meta http-equiv="content-script-type" content="text/javascript" />
  8.         <title>test centre</title>
  9.         <style type="text/css">
  10. /* <![CDATA[ */
  11. option span {
  12.     float: right;
  13. }
  15. option {
  16.     width: 10em;
  17. }
  18. /* ]]> */
  19.         </style>
  20.     </head>
  21.     <body>
  22.         <form>
  23.             <select size="1">
  24.                 <option><span>3,50</span>Muskeln</option>
  25.                 <option><span>2,74</span>Sehnen</option>
  26.                 <option><span>213,90</span>Knochen</option>
  27.                 <option><span>39,62</span>Knorpel</option>
  28.                 <option><span>89,12</span>Blut</option>
  29.                 <option><span>47,08</span>Zellen</option>
  30.                 <option><span>38,91</span>Grips</option>
  31.             </select>
  32.         </form>
  33.     </body>
  34. </html>
Aug 10 '09 #4
118 New Member

Thank you for your reply.I run the above mentioned code .But it will not work.Please suggest how i can approch.

Aug 11 '09 #5
8,658 Recognized Expert Moderator Expert
are you using IE? then use a standard compliant Browser (Firefox, Opera, …)
Aug 11 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Matt Feinstein | last post by:
Using the 'struct' module (Win32, python version 2.4.1)-- The library documentation says that 'no alignment is required for any type'. However, struct.calcsize('fd') gives 16 while struct.calcsize('df') gives 12, implying that double precision data has to start on a double-word boundary. Matt Feinstein --
by: | last post by:
hi everyone, i was hoping someone could help me. the code below - in IE the menu options (text) are a couple of pixels too low and i cant move them up, and the form boxes are ok. in mozilla the reverse is true - the text links are ok but the form boxes are too low! I cant figure out why this is happening. I want the text to be vertically...
by: sgraber | last post by:
I have encountered a class data alignment issue in Microsoft Visual Studio .Net 2003 (C++, 7.1). The issue only appears in certain configurations. My class is a simple class with no inheritance. The class includes 2 CStringArrays, 3 CStrings, 6 doubles, 2 unsigned chars, a couple of longs. If I create a copy of the class using 'new...
by: gopal | last post by:
Hi I am trying to write to log file but the formatting of string is not properly aligned in log file result The results looks some thing like this OK move.xml Successful OK AppUser_ifrUsers.asp Successful
by: VorTechS | last post by:
I'm having a problem with an inherited label, applying text rotation to aligned text. If text rotation is applied to the aligned text, the alignment goes 'nuts'. I can find no logic to what is happening. I've built the following code from several examples on the web, if you remove the rotation then alignment works fine: Imports...
by: Stephen Plotnick | last post by:
I have a checkbox in a data grid that does not change it's state until I actually leave the field. I've done this routine several times in other data grids without an issue. I'm using VB.2003. Steve
by: Rahul | last post by:
Friends, My Problem is related to writing a text file from a database using .Net. in a particular string format. I have a dataset with a table, let suppose in this table there are three fields. - Code - Description - Amount
by: Roman Mashak | last post by:
Hello, In the program I'm working on I receive a data stream, having structure as follows: | common_header | I2C_header | data ... |
by: stevedub | last post by:
I am having some trouble configuring my array to read from a sequential file, and then calling on that to fill an array of interests. I think I have the class set up to read the file, but when I run my program the rates array does not get the information. I think my problem is where I am actuall calling the array index, but I am not sure how to do...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.