One of my visitors wrote to ask how she could start a list with a number other than 1 (the default), without having to insert all the item numbers manually. That is, she wanted to use the automatic numbering facility provided by HTML, where each point in the list is given an incremental number even if you add new items into (or delete them from) the middle of the list, except that she didn't want to count from 1.
This article provides the solution using HTML. To use it, you will need to be able to modify your HTML code directly. If you use a visual editor, switch to its Source or Code mode (or whatever that editor calls its raw HTML editing facility). See the following tutorials if you don't know how to do this:
The method also works if you have a blog. Switch to its HTML entry mode to insert the code described below. For example, if you use the Block editor in WordPress (the default in the current versions), click the "+" at the top of the Add Post screen, and in the overlay that appears, click "Formatting" to expand the section. Then click "Custom HTML". You will be able to enter your code directly, from that point.
Ordered lists (the technical name for a numbered list) are denoted by <ol>
in HTML.
Take the following as an example.
Each item in the list is enclosed within <li>
and </li>
tags, where
"li" probably stands for "list item", and the entire list is enclosed within <ol>
and
</ol>
, where "ol" means "ordered list".
To start the list with some other number, say, "4", change the opening <ol>
tag so that it
now says <ol start="4">
. You can of course use any number here. "4" is just an example.
The HTML for your list will now look like this:
And the output of the above code should appear as follows:
Note that even if you
use
English letters or Roman numerals to number your lists, the start
number should still be specified as
an Arabic numeral. For example, if you want to start your list using the Roman number "viii" (ie, 8),
you will have to say "<ol start="8">
". The web browser will convert that 8 to whatever
number system you have chosen for your list.
The start
attribute is recognized by all browsers. Although the HTML 4.01 specifications
state that the feature is deprecated, (ie, it is accepted but they intend to remove it in future versions of the
language), HTML 5 has reversed this (ie, it is no longer marked for removal but will be retained).
Copyright © 2020 Christopher Heng. All rights reserved.
Get more free tips and articles like this,
on web design, promotion, revenue and scripting, from https://www.thesitewizard.com/.
Do you find this article useful? You can learn of new articles and scripts that are published on thesitewizard.com by subscribing to the RSS feed. Simply point your RSS feed reader or a browser that supports RSS feeds at https://www.thesitewizard.com/thesitewizard.xml. You can read more about how to subscribe to RSS site feeds from my RSS FAQ.
This article is copyrighted. Please do not reproduce or distribute this article in whole or part, in any form.
It will appear on your page as:
How to Start a List with a Number Other than 1 and Still Have it Automatically Numbered (HTML)