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 ]
"Sander Verhagen" <Verh...@nonono.Sander.com> wrote in message
news:O18DibEf...@TK2MSFTNGP12.phx.gbl...
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...
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