HighDots Forums  

Nested Ordered List

alt.html alt.html


Discuss Nested Ordered List in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
CK
 
Posts: n/a

Default Nested Ordered List - 06-02-2006 , 05:31 PM






Hello all,
I have a nested ol and I need help with the numbering.
For example.
<ol>
<li>Sweet</li>
<li>Salty</li>
<ol>
<li>Very Salty</li>
<li>lightly salted</li>
</ol>
<li>bitter</li>
<li>sour</li>
</ol>

I want the output to be
1.. Sweet
2.. Salty
1.1Very Salty
1.2lightly salted
3.. bitter
4.. sour
But it currently renders like this.
1.. Sweet
2.. Salty
1.. Very Salty
2.. lightly salted
3.. bitter
4.. sour
I need the decimal style. Any ideas? Thanks ~CK



Reply With Quote
  #2  
Old   
Martin Jay
 
Posts: n/a

Default Re: Nested Ordered List - 06-02-2006 , 06:10 PM






In message <I62gg.106318$dW3.10267 (AT) newssvr21 (DOT) news.prodigy.com>, CK
<c_kettenbach (AT) hotmail (DOT) com> writes
Quote:
Hello all,
I have a nested ol and I need help with the numbering.

I want the output to be
1.. Sweet
2.. Salty
1.1Very Salty
1.2lightly salted
3.. bitter
4.. sour
But it currently renders like this.
1.. Sweet
2.. Salty
1.. Very Salty
2.. lightly salted
3.. bitter
4.. sour
I need the decimal style. Any ideas? Thanks ~CK
I don't think you can do that without using a script. Couldn't you use
letters, instead?

Also, the HTML you posted was slightly incorrect because you started the
second <ol> inside the first <ol>, but outside an <li>. Try this:

<ol>
<li>Sweet</li>
<li>Salty
<ol style="list-style-type: lower-alpha;">
<li>Very Salty</li>
<li>lightly salted</li>
</ol>
</li>
<li>bitter</li>
<li>sour</li>
</ol>
--
Martin Jay
Phone/SMS: +44 7740 191877
Fax: +44 870 915 2124


Reply With Quote
  #3  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Nested Ordered List - 06-02-2006 , 06:11 PM



CK <c_kettenbach (AT) hotmail (DOT) com> scripsit:

Quote:
I have a nested ol and I need help with the numbering.
If you really want help, select _the_ group where the question best belongs
to. Crossposting is generally not constructive. Followups randomized as
usual.

Quote:
I want the output to be
1.. Sweet
2.. Salty
1.1Very Salty
1.2lightly salted
No way. (CSS 2.0 contains tools for generating list markers that way, but
this part was not implemented in browsers and is being phased out in CSS
2.1.)

Use either an unnumbered list, with list-style-type: none in CSS and with
the numbers included into the items themselves, or some other (admittedly
less logical) structure, such as a table.

Quote:
I need the decimal style.
That's a reasonable request, but browsers won't do it for you.

--
Yucca, http://www.cs.tut.fi/~jkorpela/



Reply With Quote
  #4  
Old   
dorayme
 
Posts: n/a

Default Re: Nested Ordered List - 06-02-2006 , 06:57 PM



In article <I62gg.106318$dW3.10267 (AT) newssvr21 (DOT) news.prodigy.com>,
"CK" <c_kettenbach (AT) hotmail (DOT) com> wrote:

Quote:
Hello all,
I have a nested ol and I need help with the numbering.
For example.

I need the decimal style. Any ideas? Thanks ~CK
Yes, you need to set the list-style-type. This might do you, I
will give you an inline style for now on the bit that you
probably want different to the normal decimal of the rest:

<ol style="list-style-type: lower-roman">
<li>Very Salty</li>
<li>lightly salted</li>
</ol>

--
dorayme


Reply With Quote
  #5  
Old   
dorayme
 
Posts: n/a

Default Re: Nested Ordered List - 06-02-2006 , 07:29 PM



In article
<doraymeRidThis-AC30A0.08575003062006 (AT) news-vip (DOT) optusnet.com.au>,
dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:

Quote:
In article <I62gg.106318$dW3.10267 (AT) newssvr21 (DOT) news.prodigy.com>,
"CK" <c_kettenbach (AT) hotmail (DOT) com> wrote:

Hello all,
I have a nested ol and I need help with the numbering.
For example.

I need the decimal style. Any ideas? Thanks ~CK

Yes, you need to set the list-style-type. This might do you, I
will give you an inline style for now on the bit that you
probably want different to the normal decimal of the rest:

ol style="list-style-type: lower-roman"
li>Very Salty</li
li>lightly salted</li
/ol
but it seems it was the decimal numbering you wanted... forget
this, sorry...

--
dorayme


Reply With Quote
  #6  
Old   
Ed Seedhouse
 
Posts: n/a

Default Re: Nested Ordered List - 06-03-2006 , 02:14 AM



On Fri, 02 Jun 2006 21:31:20 GMT, "CK" <c_kettenbach (AT) hotmail (DOT) com> wrote:

Quote:
Hello all,
I have a nested ol and I need help with the numbering.
For example.
ol
li>Sweet</li
li>Salty</li
ol
li>Very Salty</li
li>lightly salted</li
/ol
li>bitter</li
First, you should get your html legal:

Quote:
li>Salty
ol
li>Very Salty</li
li>lightly salted</li
/ol
/li
li>bitter</li
Everthing in an ordered list has to go inside the list items.



Reply With Quote
  #7  
Old   
ironcorona
 
Posts: n/a

Default Re: Nested Ordered List - 06-03-2006 , 02:58 AM



CK wrote:

Quote:
I want the output to be
1.. Sweet
2.. Salty
1.1Very Salty
1.2lightly salted
3.. bitter
4.. sour
But it currently renders like this.
1.. Sweet
2.. Salty
1.. Very Salty
2.. lightly salted
3.. bitter
4.. sour
I need the decimal style. Any ideas? Thanks ~CK
I couldn't make it work with a list but in the interests of science I
came up with a sort of hackey workaround.

http://iron.corona.googlepages.com/list_counter.html

As you can see it's not a list any more and it won't work in IE.

Does anyone know when FF started supporting counter-increment? They
didn't quite recently.

--
Brian O'Connor (ironcorona)


Reply With Quote
  #8  
Old   
Bud
 
Posts: n/a

Default Re: Nested Ordered List - 06-03-2006 , 03:34 PM



ironcorona wrote:
Quote:
CK wrote:

I want the output to be
1.. Sweet
2.. Salty
1.1Very Salty
1.2lightly salted
3.. bitter
4.. sour
But it currently renders like this.
1.. Sweet
2.. Salty
1.. Very Salty
2.. lightly salted
3.. bitter
4.. sour
I need the decimal style. Any ideas? Thanks ~CK

I couldn't make it work with a list but in the interests of science I
came up with a sort of hackey workaround.

http://iron.corona.googlepages.com/list_counter.html

As you can see it's not a list any more and it won't work in IE.

Does anyone know when FF started supporting counter-increment? They
didn't quite recently.
In Konqueror it does but in FF 1.0.2 no, but that is old now.

--
"I never fail to convince an audience that the best thing they could do
was to go away."
I'm going back to windoze, too many dammed options with linux
-- Blumf


Reply With Quote
  #9  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: Nested Ordered List - 06-03-2006 , 05:00 PM



Bud wrote:
Quote:
ironcorona wrote:
CK wrote:

I want the output to be
1.. Sweet
2.. Salty
1.1Very Salty
1.2lightly salted
3.. bitter
4.. sour
But it currently renders like this.
1.. Sweet
2.. Salty
1.. Very Salty
2.. lightly salted
3.. bitter
4.. sour
I need the decimal style. Any ideas? Thanks ~CK
I couldn't make it work with a list but in the interests of science I
came up with a sort of hackey workaround.

http://iron.corona.googlepages.com/list_counter.html

As you can see it's not a list any more and it won't work in IE.

Does anyone know when FF started supporting counter-increment? They
didn't quite recently.

In Konqueror it does but in FF 1.0.2 no, but that is old now.

Fixed in FF 1.5+

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #10  
Old   
jojo
 
Posts: n/a

Default Re: Nested Ordered List - 06-18-2006 , 05:41 PM



Martin Jay schrieb:
Quote:
In message <I62gg.106318$dW3.10267 (AT) newssvr21 (DOT) news.prodigy.com>, CK
c_kettenbach (AT) hotmail (DOT) com> writes
Hello all,
I have a nested ol and I need help with the numbering.

I want the output to be
1.. Sweet
2.. Salty
1.1Very Salty
1.2lightly salted
3.. bitter
4.. sour
But it currently renders like this.
1.. Sweet
2.. Salty
1.. Very Salty
2.. lightly salted
3.. bitter
4.. sour
I need the decimal style. Any ideas? Thanks ~CK

I don't think you can do that without using a script.
But, of course, you can use a script...
Easiest way would be JavaScript because it's supported by almost every
Browser. The only problem is, that many users switch off JavaScript
because of security-reasons. But if you want to do it with a Script just
tell me, I think I can write you a Script numbering your list as you
requested...


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.