I'm attempting to build a phone directory into a CSS dropdown menu. I'm aiming for it to render like a typical phone book would, with the names aligned left and the phone extensions/numbers aligned right, like so:
James T. Kirk x1701
Mr. Spock (123) 555-8795
The HTML is pretty straightforward:
<ul id="phone">
<li>
Phone Category 1
<ul>
<li>
<span class="phone-description">Phone Description 1</span>
<span class="phone-number">x55555</span>
</li>
<li>
<span class="phone-description">Longer Phone Description 2</span>
<span class="phone-number">(800) 555-1234 x1701</span>
</li>
</ul>
</li>
...
</ul>
The basic formatting is fairly simple as well:
body {background: #999;}
ul {list-style: none; margin: 0; padding: 0;}
li {margin: 0; padding: 0.4em 2em 0.4em 1em; white-space: nowrap;}
#phone {position: fixed; top: 0; left: 0;}
#phone li {background: #FFF; position: relative;}
#phone li:hover {background: #CCC;}
#phone ul {display: none; position: absolute; top: 0; left: 100%;}
#phone li:hover ul {display: block;}
.phone-number {margin-left: 2em;}
Making the columns, however, has proven to be extremely difficult. I've attempted using text-align, floats, absolute positioning, and the CSS brilliance explained at "Fluid width with equally spaced DIVs."
I've put the above code up at http://jsfiddle.net/HQ4ZN/2/, along with each of my attempted solutions commented out. Any help you can provide would be much appreciated!