473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with option tag alignment

118 100+
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 5428
Dormilich
8,658 Expert Mod 8TB
you could try to float (CSS) the price right (<span> should be OK)
Aug 10 '09 #2
swethak
118 100+
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 Expert Mod 8TB
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 100+
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 Expert Mod 8TB
@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
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...
9
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...
1
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....
8
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 ...
0
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...
1
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. ...
10
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....
9
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
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.