> How about using a table, as this does look like tabular data to me?
> Then you could easily align the TH to the right and the TD to the
> left.

In the new world of CSS, aren't we supposed to avoid tables? 

> Same applies to your span solution - give the first span a fixed
> width, display it block, float it to the left and text-align it to the
> right.

Yep, that is just what I was looking for:

HTML:

  <div class="container">
    <ul class="properties">
      <li><span class="name">Name:</span><span class="value">Value</span></li>
      <li><span class="name">Another name:</span><span class="value">Another 
value</span></li>
      <li><span class="name">Other name:</span><span class="value">Other 
value</span></li>
    </ul>
  </div>

CSS:

  ul.properties {
    list-style: none;
  }
                  
  ul.properties span.name {
    display: block;
    float: left;
    width: 10em;
    text-align: right;
  }

Thanks,
Curious.

On Wed, Nov 09, 2005 at 10:22:50PM +0000, Christian Heilmann wrote:
> > I have a list of name:value pairs:
> >
> >   <div class="container">
> >
> >     <ul class="properties">
> >     <li>Name: Value</li>
> >         <li>Another name: Another value</li>
> >         <li>Other name: Other value</li>
> >         </ul>
> >
> >   </div>
> 
> How about using a table, as this does look like tabular data to me?
> Then you could easily align the TH to the right and the TD to the
> left.
> 
> Same applies to your span solution - give the first span a fixed
> width, display it block, float it to the left and text-align it to the
> right.
> 
> --
> Chris Heilmann
> Blog: http://www.wait-till-i.com
> Writing: http://icant.co.uk/
> Binaries: http://www.onlinetools.org/
> 
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to