Jump to content

Cascading Enumerated Lists?


davygora
 Share

Recommended Posts

Hello everyone, after googling around and searching this board too, unfortunately I haven't found anything useful. My question is this: how could I created cascaded lists with corresponding enumerating, like

  1. Item 1  2. Item 2	2.1. Subitem 2.1	2.2. Subitem 2.2	2.3. Subitem 2.3  3. Item 3	3.1. Subitem 3.1	3.2. Subitem 3.2

and similar? The naive try

  <ol>	 <li> Item 1 </li>	 <li>		Item 2		<ol>		  <li>Subitem 2.1</li>		  <li>Subitem 2.2</li>		  <li>Subitem 2.3</li>		</ol>	  </li>	 <li>		Item 3		<ol>		  <li>Subitem 3.1</li>		  <li>Subitem 3.2</li>		</ol>	  </li>  </ol>

leads to output

  1. Item 1  2. Item 2	1. Subitem 2.1	2. Subitem 2.2	3. Subitem 2.3  3. Item 3	1. Subitem 3.1	2. Subitem 3.2

Is it possible to somehow achieve my desired result? Thank you in advance for your help!

Link to comment
Share on other sites

It is possible by the use of CSS counters, but keep in mind that it doesn't work in IE7 and below.See this article for an exampe. Also, keep in mind that it's buggy in Opera, at least up to and including version 10.00.

Link to comment
Share on other sites

It is possible by the use of CSS counters, but keep in mind that it doesn't work in IE7 and below.See this article for an exampe. Also, keep in mind that it's buggy in Opera, at least up to and including version 10.00.
Thank you for your reply. As I understand, there are no hacks for IE7 and below, otherwise you would have told me. Is there no other way?
Link to comment
Share on other sites

There are JavaScript libraries that try to hack IE7 and below into supporting these, such as Dean Edwards' IE7 library and the like, but I don't know how/if they support CSS counters, as honestly, I've never used that property, exactly because IE7's usage share is still high, and even though I've already dismissed IE6, I plan to support IE7 for a while longer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...