This Question have 3 answers right now.

Google Finance - Get Quotes search box - Column Alignment

By : BCS
Source: Stackoverflow.com
Question!

How does Google manage to properly align the second column (i.e. the ticker name) in the "Get Quotes" search box suggestion dropdown in http://finance.google.com?

Example: If you enter "iii" - the second column is perfectly aligned.

It does not use a fixed-width font - so just adding the correct numbers of spaces to the "ticker" will not work.

How do they do that?

By : BCS


Answers

I just viewed source with a DOM inspector and it appears that they are spans for each cell with a margin set (as Darren said) to position the right column over.

By : travis


most likely just using margins. float the first column left then set the margin to the width of the first column.



The answer provided by nlucaroni will only work for positive numbers. A possible solution that works for both positive as well as negative numbers is:

$x = $x - intval($x)



Wrapping lists into columns


How to set up a CSS switcher

Autosizing textarea using Prototype

style.display not working in Firefox, Opera, Safari - IE7 OK

Setting the height of a DIV dynamically

Making an iframe take vertical space

Can I stop .NET eating IDs?

Most elegant way to force a TEXTAREA element to line-wrap, *regardless* of whitespace

Google Finance - Get Quotes search box - Column Alignment

CSS overflow table row positioning

Will .NET MVC give me the HTML/CSS/JS separation I need?


What is the best online javascript/css/html/xhtml/dom reference? [closed]

Is there a way to make text unselectable on an HTML page? [duplicate]

How to set up the browser scrollbar to scroll part of a page?

Google Maps, Z Index and Drop Down Javascript menus

How to center text over an image in a table using javascript, css, and/or html?

How to implement a web page that scales when the browser window is resized?

What are some excellent examples of user sign-up forms on the web? [closed]

Make a div fade away nicely after a given amount of time

Video about Google Finance - Get Quotes search box - Column Alignment