HighDots Forums  

Left-aligning numbers in ordered lists

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Left-aligning numbers in ordered lists in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tgscott
 
Posts: n/a

Default Left-aligning numbers in ordered lists - 07-25-2006 , 04:27 AM






Hi,

By default numbers in ordered lists are right aligned, like this...

1. Item
2. Item
....
10. Item
11. Item

Does anyone know how to align them to the left, like this?

1. Item
2. Item
....
10. Item
11. Item

Many thanks,
Tom


Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Left-aligning numbers in ordered lists - 07-25-2006 , 04:00 PM






tgscott <tomgscott (AT) gmail (DOT) com> scripsit:

Quote:
By default numbers in ordered lists are right aligned,
So it seems, though this is just common browser behavior; it is not
specified in CSS specifications.

Quote:
Does anyone know how to align them to the left,
I don't think so. If such rendering is important, you should probably change
the markup from <ol> to <table>, with two columns (one for the numbers and
one for the item texts). You would naturally have to make the numbers actual
page content, instead of letting browsers generate them. On the positive
side, this approach would let you style the appearance in detail.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #3  
Old   
tgscott
 
Posts: n/a

Default Re: Left-aligning numbers in ordered lists - 07-26-2006 , 05:13 AM



Thanks for your suggestion, Jukka. I'd come to the same conclusion!

Tom


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.