Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Continuing list numbering

0 views
Skip to first unread message

Sander Verhagen

unread,
Sep 16, 2003, 7:37:10 AM9/16/03
to
Hi,


I have a ordered list that is broken up by headers. How can I have the
numbering to continue?

<H1>Some title</H1>
<OL>
<LI>Text</LI>
<LI>Text</LI>
</OL>
<H1>Other title</H1>
<OL>
<LI>Text</LI>
<LI>Text</LI>
</OL>

Should give:

Some title
1. Text
2. Text
Other title
3. Text
4. Text

I know I can set <LI VALUE=3> but I was hoping for a solution without just
that approach.

Thanks,


Sander Verhagen
[ Verh...@nonono.Sander.com ]


Gav

unread,
Sep 16, 2003, 7:51:17 AM9/16/03
to
Whats wrong with using VALUE=3?
Regards
Gavin

"Sander Verhagen" <Verh...@nonono.Sander.com> wrote in message
news:O18DibEf...@TK2MSFTNGP12.phx.gbl...

Sander Verhagen

unread,
Sep 17, 2003, 3:56:50 AM9/17/03
to
Hi,


Long list, broken up at many points, and there are often entries added,
somewhere in the middle. You see the inconvenience?


Sander Verhagen
[ Verh...@nonono.Sander.com ]


"Gav" <sp...@spam.com> wrote in message
news:O1NJZjEf...@TK2MSFTNGP11.phx.gbl...

Steve Fulton

unread,
Sep 17, 2003, 8:05:58 AM9/17/03
to
Sander Verhagen wrote:
> Long list, broken up at many points, and there are often entries added,
> somewhere in the middle. You see the inconvenience?

If MS had implemented CSS-2 (a five-year-old spec!), you could use CSS
counters[1]. Instead, they gave use colored scroll bars, so you have to script a
DHTML solution.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Continue OLs</title>
<script type="text/javascript">
function renumberOLs(div) {
var ol = div.getElementsByTagName('ol');
var value = 1;
for (var i=0; i<ol.length; ++i) {
var li = ol[i].getElementsByTagName('li')
li[0].value = value;
value += li.length;
}
}
</script>
</head>
<body onload="renumberOLs(document.getElementById('humbug'));">
<div id="humbug">
<h1>Some title</h1>
<ol>
<li>Text</li>
<li>Text</li>
</ol>
<h1>Other title</h1>
<ol>
<li>Text</li>
<li>Text</li>
</ol>
</div>
</body>
</html>

---
[1]"12.5 Automatic counters and numbering", /Cascading Style Sheets, level 2/,
W3C Recommendation 12-May-1998,
http://www.w3.org/TR/REC-CSS2/generate.html#counters
--
Steve

The truth is rarely pure, and never simple. -Oscar Wilde


0 new messages