Re: Multi-level ordered list



Don84 wrote on 21 nov 2009 in comp.infosystems.www.authoring.stylesheets:

I'm wondering if there's a way to support ordered list inside an
ordered list. In other words, the ability to create multi-level
structures such as
1. Products
1.1 Pen
1.2 Computer
1.n Food

2. Users
2.1 Generic consumers
2.2 College students
2.n ...

3 Comments
...

Browsers: IE7? IE8? Firefox 3.5?

I've tried to even create the second level manually, e.g.
1.1, bla bla,
1.2 more bla bla.
Had some success with Firefox 3.5 but completely out of
luck with IE7, tried Firefox again but failed. The web page
uses frame with execCommand of InsertOrderList. It must not be manual
coding.

Must?? Why, this a school exercise?
Manual coding?? Do you have a virtual programmer?

Using Javascript there are many possibilities, even without <li>:

=====================================
<script type='text/javascript'>
var l1,l2;
function level1(s) {
document.write('<br>'+ ++l1 +'.&nbsp;'+s);
l2 = 0;
};
function level2(s) {
document.write('<br>&nbsp;&nbsp;&nbsp;'+ l1 + '.' + ++l2 +'.
&nbsp;'+s);
};
</script>

<body>
<script type='text/javascript'>
l1=0;
level1('Products');
level2('Pen');
level2('Computer');
level2('Food');
level1('Users');
level2('Generic consumers');
level2('College students');
level2('...');
level1('Comments');
</script>
=================================

Serverside coding is also an option.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.



Relevant Pages

  • Re: Ordered list inside ordered list
    ... Generic consumers ... Browsers: IE7? ... more bla bla. ... Had some success with Firefox 3.5 two nights ago but completely out of ...
    (comp.lang.javascript)
  • Multi-level ordered list
    ... the ability to create multi-level ... Browsers: IE7? ... more bla bla. ... Had some success with Firefox 3.5 but completely out of ...
    (comp.infosystems.www.authoring.stylesheets)
  • Ordered list inside ordered list
    ... the ability to create multi-level ... Browsers: IE7? ... more bla bla. ... Had some success with Firefox 3.5 two nights ago but completely out of ...
    (comp.lang.javascript)
  • Re: Find string on a row and sum value from same row....
    ... Create a list of all project ids and Coding and Testing, ... "Bob Phillips" wrote: ... 1:0 JobA ...
    (microsoft.public.excel.programming)
  • Re: Set asp:textbox value to current url in Firefox?
    ... found any issues with the coding itself... ... I know that Firefox has issues with understanding some ... Do you think there is something wrong with Firefox simply not ... can make garbage code work in IE when it won't work anywhere else. ...
    (microsoft.public.scripting.jscript)