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


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



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


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








Thanks
Swetha
Aug 10 '09 #3
Dormilich
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. }
  14.  
  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
swethak
118 New Member
Hi,


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









Thanks
Sravani
Aug 11 '09 #5
Dormilich
8,658 Recognized Expert Moderator Expert
@swethak
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

2
1840
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 --
9
2026
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...
1
1110
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...
8
1770
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
0
1787
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...
1
1956
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
10
2272
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
9
2241
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 ... |
1
2911
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...
0
7841
marktang
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...
0
8105
Oralloy
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. ...
0
8272
jinu1996
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...
1
7859
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...
1
5657
isladogs
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...
0
5336
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...
0
3793
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2274
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
0
1101
bsmnconsultancy
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.