473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

nested list to show 1.1

mlf
Is there a clever way, or any way for that matter, to have a nested list
show 1.1, 1.2, 1.3...2.1, 2.2, etc?

Jul 21 '05 #1
11 15410
mlf <vz**@verzon.net> wrote:
Is there a clever way, or any way for that matter, to have a nested
list show 1.1, 1.2, 1.3...2.1, 2.2, etc?


Not in CSS as currently defined and implemented. The best approach is
to include the numbers into the list items themselves and use <ul>
markup together with list-style-type: none.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 21 '05 #2
Jukka K. Korpela wrote:
mlf <vz**@verzon.net> wrote:

Is there a clever way, or any way for that matter, to have a nested
list show 1.1, 1.2, 1.3...2.1, 2.2, etc?

Not in CSS as currently defined and implemented. The best approach is
to include the numbers into the list items themselves and use <ul>
markup together with list-style-type: none.


.... and hope that the list item text does not wrap. Or play with
margin-, padding-left and negative text-indent.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 21 '05 #3
On Mon, 07 Mar 2005 22:16:45 GMT mlf wrote:
Is there a clever way, or any way for that matter, to have a nested list
show 1.1, 1.2, 1.3...2.1, 2.2, etc?


For a csss version see www.suckerfish.org
javascript version see www.4thorder.us
For a working demo see www.somestuff.batcave.net
Jul 21 '05 #4
in comp.infosystems.www.authoring.stylesheets, Johannes Koch wrote:
Jukka K. Korpela wrote:
mlf <vz**@verzon.net> wrote:

Is there a clever way, or any way for that matter, to have a nested
list show 1.1, 1.2, 1.3...2.1, 2.2, etc?

Example:
http://www.student.oulu.fi/~laurirai...alifornia.html
(list floated left)
Works with only Opera, since version 5, IIRC. (could be v4). Should
degrade ok on all browsers, but shouldn't be used if it is important to
get numbers right.
Not in CSS as currently defined and implemented.
Especially implemented. Also, often it is questionable if it is just
style, but also content.
The best approach is
to include the numbers into the list items themselves and use <ul>
markup together with list-style-type: none.

I would use ol, if order of list items is important, but numbering style
is not. But usually ul is good.
... and hope that the list item text does not wrap. Or play with
margin-, padding-left and negative text-indent.


Floating marker will work ok. See for example
http://www.student.oulu.fi/~laurirai...2.html#lahteet
(I can't remember why I didn't use ol, but at least we have example...
Content on that site might be bullshit as well, but most of you won't
understand it anyway, as it is Finnish...)

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Jul 21 '05 #5
Richard wrote:
On Mon, 07 Mar 2005 22:16:45 GMT mlf wrote:
Is there a clever way, or any way for that matter, to have a
nested list show 1.1, 1.2, 1.3...2.1, 2.2, etc?
For a csss version see www.suckerfish.org


Site not found.
http://dnsstuff.com/tools/whois.ch?ip=suckerfish.org
javascript version see www.4thorder.us
Don't see any 1.1, 1.2 .. lists on that page, and there is some amount
of text *outside* the left margin of my browser. Poor layout.
For a working demo see www.somestuff.batcave.net


One of the worst pages I've seen in years.

mlf: disregard Richard's advice.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #6
Lauri Raittila <la***@raittila.cjb.net> wrote:
> The best approach is
> to include the numbers into the list items themselves and use
> <ul> markup together with list-style-type: none.


I would use ol, if order of list items is important, but numbering
style is not. But usually ul is good.


Using ol implies the risk (well, certainty) of getting extra numbers,
like
3 1.3
where 1.3 is the number you have in the content and 3 is the browser
generated number, when CSS is not in use or your style sheet is
overridden (some users might conceivably want to enforce their own
preferred numbering style for numbered lists).

You could reduce the risks by using <ol type="disc">, but that would
really just say that you want to have the list unnumbered but still use
<ol> markup.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 21 '05 #7
On Mon, 7 Mar 2005 16:58:37 -0600 Richard wrote:
On Mon, 07 Mar 2005 22:16:45 GMT mlf wrote:
Is there a clever way, or any way for that matter, to have a nested list
show 1.1, 1.2, 1.3...2.1, 2.2, etc?


For a csss version see www.suckerfish.org
javascript version see www.4thorder.us
For a working demo see www.somestuff.batcave.net


Dang it. I keep forgetting the proper url.

http://www.htmldog.com/articles/suckerfish/dropdowns/

Jul 21 '05 #8
On Mon, 07 Mar 2005 20:10:34 -0500 Beauregard T. Shagnasty wrote:
Richard wrote:
On Mon, 07 Mar 2005 22:16:45 GMT mlf wrote:
Is there a clever way, or any way for that matter, to have a
nested list show 1.1, 1.2, 1.3...2.1, 2.2, etc?


For a csss version see www.suckerfish.org


Site not found.
http://dnsstuff.com/tools/whois.ch?ip=suckerfish.org
javascript version see www.4thorder.us


Don't see any 1.1, 1.2 .. lists on that page, and there is some amount
of text *outside* the left margin of my browser. Poor layout.


Sheesh. You just have to nitpick don't you?
1.0 would be equal to ul li.
1.1 would be equal to ul li li.

For a working demo see www.somestuff.batcave.net


One of the worst pages I've seen in years.


Then you ain't seen many have you?

You forgot to mention www.rts.batcave.net
Speaking of shitty pages.
Jul 21 '05 #9
Richard wrote:
On Mon, 07 Mar 2005 20:10:34 -0500 Beauregard T. Shagnasty wrote:
[Richard wrote:]
javascript version see www.4thorder.us


Don't see any 1.1, 1.2 .. lists on that page, and there is some
amount of text *outside* the left margin of my browser. Poor
layout.


Sheesh. You just have to nitpick don't you?


When you give bad or irrelevant advice...
1.0 would be equal to ul li.
1.1 would be equal to ul li li.
...which has nothing whatsoever to do with the OP's question, who
wanted an <ol><li> _list_item_number_ to be 1.1, 1.2 ...
For a working demo see www.somestuff.batcave.net


One of the worst pages I've seen in years.


Then you ain't seen many have you?


Few that are that bad.
You forgot to mention www.rts.batcave.net Speaking of shitty pages.


...which of course is a pure parody of your own unworthy site. It
should be shitty.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #10
"Richard" <An*******@127.001> wrote:
On Mon, 07 Mar 2005 20:10:34 -0500 Beauregard T. Shagnasty wrote:
Richard wrote:
On Mon, 07 Mar 2005 22:16:45 GMT mlf wrote:

Is there a clever way, or any way for that matter, to have a
nested list show 1.1, 1.2, 1.3...2.1, 2.2, etc?

For a csss version see www.suckerfish.org
Site not found.
http://dnsstuff.com/tools/whois.ch?ip=suckerfish.org
javascript version see www.4thorder.us


Don't see any 1.1, 1.2 .. lists on that page, and there is some amount
of text *outside* the left margin of my browser. Poor layout.


Sheesh. You just have to nitpick don't you?
1.0 would be equal to ul li.


But what's the code to make the browser display the 1.0? ul li just
selects all li elements that are descendents of ul elements. Big deal.
Now add the desired numbering
1.1 would be equal to ul li li.


Again, that just selects all li elements that are descendents of li
element that are in turn descendents of ul elements. How do you add
the numbering?

Please post your code that creates an automatically numbered list
where the number in the sub-list goes 1.1, 1.2, 1.3, etc. This is
something that people have wanted for many years but none of the
experts here and elsewhere have ever been able to create with current
CSS. If you can do this then (a) we'd all be very amazed and (b) we'd
all be very grateful. Come on show us an example.

I don't believe it can be done with CSS at present. I'd be interested
in testing the robustness and fallback in a JS solution if you have
one of those.
For a working demo see www.somestuff.batcave.net


One of the worst pages I've seen in years.


Then you ain't seen many have you?


No, your page is very, very bad. And I see no lists with 1.1, 1.2, 1.3
numbering on your page.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #11
"Richard" <An*******@127.001> wrote:
On Mon, 7 Mar 2005 16:58:37 -0600 Richard wrote:
On Mon, 07 Mar 2005 22:16:45 GMT mlf wrote:
Is there a clever way, or any way for that matter, to have a nested list
show 1.1, 1.2, 1.3...2.1, 2.2, etc?


For a csss version see www.suckerfish.org
javascript version see www.4thorder.us
For a working demo see www.somestuff.batcave.net


Dang it. I keep forgetting the proper url.

http://www.htmldog.com/articles/suckerfish/dropdowns/


But where's the 1.1, 1.2, 1.3 numbering? The fact that the examples
all use <ul> - unordered lists rather than <ol> - ordered lists
suggests that these lists aren't supposed to be numbered? So why offer
them as an example of how to create a particular numbering style?

Having trouble with that pesky comprehension thing again?

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brett | last post by:
I am trying to pass the value of a nested list into a function (to my "if" statement) as follows: textfilelist = "]] def idfer(listlength, comparelistlength, list): while x < (listlength - 1):...
4
by: Lee K. Seitz | last post by:
I'm still relatively new to stylesheets. I'm trying to do something that seemed fairly simple on the surface, but is proving to be a challenge. I have a set of nested lists: <ul> <li>Side...
2
by: alexandre_irrthum | last post by:
Hello, I'd like to apply a function to elements of a nested list and wondered if there is anything more idiomatic and/or shorter than this recursive way: >>> def recur_map(f, data): .... if...
6
by: deko | last post by:
How do I construct an XHTML-compliant nested unordered list? This displays correctly (both FF and IE): <ul> <li>list item</li> <li>list item</li> <li>list item</li> <ul> <li>nested list...
7
by: patrick j | last post by:
Hi I'm wondering about lists with nested lists as one does on a Saturday afternoon. Anyway below is an example of a list with a nested list which the iCab browser's very useful HTML...
2
by: torbs | last post by:
Hi I have expanded an suckerfish-type menu ( http://testwww.sogn.vgs.no?p=first ), but I have a problem with Internet Explorer. I believe it is because of the z-index-problem. Am I correct? Can...
2
by: Gentr1 | last post by:
Hi everybody! I am presently working on a Genetic Programming API in python. I have a bit of a problem at the moment... For some specific reasons, I am using nested lists data structure to...
1
by: TAL651 | last post by:
I have a nested list with three levels: <ul> <li>Main Point 1 <ul> <li>Sub point 1 <ul> <li>sub-sub point a</li> </ul> ...
3
by: suneelkn | last post by:
Unable to identify the same level for nested lists in all scenarios, when the nested-list inside an ordered list the conversion process executes with out proper list order for nested list items. The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.