How to Change the Numbering in an Ordered List

by Michael on December 16, 2012 · 0 comments

I recently ran into a scenario in which I wanted to change the numbering of an ordered list. In short, I was writing a book review and wanted to created separate numbered lists for the chapters in each section of the book.

To do this properly, I need the second (and subsequent) lists to start with an arbitrary number. Little did I know that this is dead simple to achieve.

<ol start="5">

(or whatever number you want it to start with)

If you’d prefer to control the number of individual list items on a one-off basis, try doing this instead:

<li value="10">

(or whatever number is appropriate)

If you have additional list items, it will pick up the numbering from the specified value unless you specify another value for subsequent items.

There are probably other (perhaps more elegant) solutions, but this works.

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: