By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,787 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,787 IT Pros & Developers. It's quick & easy.

OL tag with style for decrementing?

P: n/a
The OL tag still allows for a START value, but that is now deprecated.
I've found sound references that suggest the proper technique now is
to control it with a style for the OL in quetion, but I haven't been
able to find the proper reference. What I actually want is an ordered
list that counts down to one. Are negative increments even possible?
Doesn't seem like a ridiculous idea in the real world, but...

(Yes, I also searched these newsgroups and also failed there...
Various keywords such as "negative increment" and "decrement" and
"counting down", but no joy.")

Feb 28 '07 #1
Share this Question
Share on Google+
25 Replies


P: n/a
Gazing into my crystal ball I observed "Shannon Jacobs"
<Sh*******************@gmail.comwriting in news:1172642991.695267.45650
@a75g2000cwd.googlegroups.com:
The OL tag still allows for a START value, but that is now deprecated.
I've found sound references that suggest the proper technique now is
to control it with a style for the OL in quetion, but I haven't been
able to find the proper reference. What I actually want is an ordered
list that counts down to one. Are negative increments even possible?
Doesn't seem like a ridiculous idea in the real world, but...

(Yes, I also searched these newsgroups and also failed there...
Various keywords such as "negative increment" and "decrement" and
"counting down", but no joy.")

This might help: http://www.w3.org/TR/REC-CSS2/generate.html

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Feb 28 '07 #2

P: n/a
Scripsit Adrienne Boswell:
This might help: http://www.w3.org/TR/REC-CSS2/generate.html
The theory is there, but
a) the CSS 2 recommendation is in practice obsolete and isn't even referred
to on W3C's pages on CSS when listing versions of CSS; the CSS 2.1 draft is
what we're supposed to use, although it says that it is an unstable draft,
mere "work in progress"
b) generated content does not work on IE (even IE 7)
c) marker properties, which would be needed for smooth implementation of the
idea of decrementing numbers as list markers, in addtion to being removed in
CSS 2.1, don't work on any browser, more or less.

The conclusion is that you should include the numbers as data (perhaps
generating them using some server-side technique) and probably use <ul>
markup with list-style-type: none. You might wish to put the numbers inside
some <spanmarkup in order to be able to style them; you may need to use
float: left in order to make those elements behave as block elements for
which you can effectively set the width property.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Feb 28 '07 #3

P: n/a
Shannon Jacobs wrote:
The OL tag still allows for a START value, but that is now deprecated.
Which (IMHO) was a very silly thing for them to have done. I firmly
believe that the number at which a list begins _is_ semantic data and
not simply a style choice. For example, in the below list the numbering
is *crucial*:

--- start ---
1. The following points should be addressed

A. More choice of food
B. More choice of drinks

2. In cases where the above points A and B cannot be observed,
point C below should take priority

C. Better tasting dips.
--- end ---

Perhaps not a real world example, but I can't really think of one at the
moment. I have on many occasions had to use the start attribute when
creating documents for clients, and I can certainly say that I'd have
been lost without it.

In the example above, unless the second list actually begins with 'C'
then the point above it does not make any sense, as if it were left to
styling (as opposed to an attribute) then the style may not be supported
and so the list would begin at 'A' again, so there would be no point 'C'
to which to refer.

This is one of those cases where it is my opinion that you can break the
rules. Mainly because you _know_ you are breaking them, and have a
_valid_ reason for doing so.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.
Feb 28 '07 #4

P: n/a
On Feb 28, 8:10 pm, Dylan Parry <use...@dylanparry.comwrote:
Shannon Jacobs wrote:
<snip>
This is one of those cases where it is my opinion that you can break the
rules. Mainly because you _know_ you are breaking them, and have a
_valid_ reason for doing so.
Well, I've done some more digging on it, and it clearly seems to be an
example of "You can't get there from here." The CSS solutions that I
found were kind of appalling, actually. However, I'm still kind of
amazed. It seems to be an extremely natural thing to do, and the
implementation seems to be quite trivial--but they decided not to do
it. There are two natural orders for numbered lists--but only one
around this browserverse.

Feb 28 '07 #5

P: n/a
Gazing into my crystal ball I observed Dylan Parry
<us****@dylanparry.comwriting in news:45e56310$0$764$bed64819
@news.gradwell.net:
Which (IMHO) was a very silly thing for them to have done. I firmly
believe that the number at which a list begins _is_ semantic data and
not simply a style choice. For example, in the below list the
numbering
is *crucial*:

--- start ---
1. The following points should be addressed

A. More choice of food
B. More choice of drinks

2. In cases where the above points A and B cannot be observed,
point C below should take priority

C. Better tasting dips.
--- end ---

Perhaps not a real world example, but I can't really think of one at
the
moment.
Agree with you completely. I can think of many times when I have been
going through and converting a legal document into HTML where this would
be crucial. Lawyers love ordered lists that start, stop and start over.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Feb 28 '07 #6

P: n/a
Adrienne Boswell wrote:
I can think of many times when I have been going through and
converting a legal document into HTML where this would be crucial.
Lawyers love ordered lists that start, stop and start over.
Yes, those sort of documents are exactly the type I was thinking off at
the time. A lot of the documents I work with are local government
planning policy documents, and they tend to have lots of lists in this
fashion too.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.
Feb 28 '07 #7

P: n/a
In article
<11*********************@a75g2000cwd.googlegroups. com>,
"Shannon Jacobs" <Sh*******************@gmail.comwrote:
What I actually want is an ordered
list that counts down to one.
An ordered list is really - in the heart of heart of things - a
table. The tabular data is thus: in the left col, is the order of
something while in the right col is the thing.

No one, therefore, should feel too inhibited in using a table
where an ordered list is required. Your case cries out for it.

--
dorayme
Feb 28 '07 #8

P: n/a
On 2007-02-28, dorayme <do************@optusnet.com.auwrote:
In article
<11*********************@a75g2000cwd.googlegroups .com>,
"Shannon Jacobs" <Sh*******************@gmail.comwrote:
>What I actually want is an ordered
list that counts down to one.

An ordered list is really - in the heart of heart of things - a
table. The tabular data is thus: in the left col, is the order of
something while in the right col is the thing.

No one, therefore, should feel too inhibited in using a table
where an ordered list is required. Your case cries out for it.
I was about to say "ego te baptizo carpam", googled for the phrase to
check people would be able to find what it meant, and found it used by
someone else in a similar context:

http://www.thescripts.com/forum/thread101208.html

but making a different point. I disagree with Peter Maas. display:
table-cell is pure as the driven snow, and just as legitimate as
display: float or anything else.

Talking yourself into believing that a list is a form of tabular data is
definitely going one better.
Feb 28 '07 #9

P: n/a
On Mar 1, 12:13 am, Dylan Parry <use...@dylanparry.comwrote:
Adrienne Boswell wrote:
I can think of many times when I have been going through and
converting a legal document into HTML where this would be crucial.
Lawyers love ordered lists that start, stop and start over.

Yes, those sort of documents are exactly the type I was thinking off at
the time. A lot of the documents I work with are local government
planning policy documents, and they tend to have lots of lists in this
fashion too.

--
Dylan Parryhttp://electricfreedom.org|http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.
I think there has been a confusing attribution made to me in this
thread. I'm just bothered by the lack of countdown lists, since there
seem to be plenty of cases where a list should start with a higher
number, say 10, and count down to one. The implementation would seem
to be very straightforward. The browser has to scan forward to the end
of the list as part of laying it out separately from the next item,
and it could easily keep count of how many list items there are while
it's doing so. Once the number of items is known, it's trivial to
subtract the count from that number as it comes back down the list.

Y'all seem to be arguing for more arbitrary list structures, and in
particular for interleaved lists. Actually that makes me feel somewhat
queasy... As an advocate of structured programming, I wouldn't want to
strongly advocate such a thing, though I suppose it is reasonable to
give such generalized capabilities to people who really want it. If
you're going to start arguing for arbitrary GOTO statements, I think
I'll have to leave the room...

Mar 1 '07 #10

P: n/a
Shannon Jacobs wrote:
I'm just bothered by the lack of countdown lists, since there seem to
be plenty of cases where a list should start with a higher number,
say 10, and count down to one.
Ah, I understand now. My mistake. I can see where you're coming from on
this one as well; there are indeed many occasions when this sort of list
would be handy, for example "The top ten annoying things about ordered
lists" :)

I think this would also be one of those times where simply styling the
list with decrementing numbers simply would not convey the meaning of
the list to those without support for that styling method. As this would
be a fundamental structuring argument within the list it would,
semantically, have to be dealt with by attributes such as (the
non-existent) order="asc" or order="dsc" - without support for such an
attribute, the meaning of the list could be altogether lost when the
style is not supported.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.
Mar 1 '07 #11

P: n/a
dorayme wrote:
>
An ordered list is really - in the heart of heart of things - a
table.
Do you propose nested tables in place of nested lists? That's just plain
icky.

--
Berg
Mar 1 '07 #12

P: n/a
In article <54*************@mid.individual.net>,
Bergamot <be******@visi.comwrote:
dorayme wrote:

An ordered list is really - in the heart of heart of things - a
table.

Do you propose nested tables in place of nested lists? That's just plain
icky.
"Plain icky" eh? And we have been seeing the use of "cool" lately
too. You snipped the reason I gave (which may be right or wrong
or not understood) for the foundation of my view. This reason,
which you might care to reinstate at some stage (it might be a
bit icky or uncool for me to do so) would also be a reason to use
nested tables if they were called for. In other words, if nested
tables are ever called for in the presentation of tabular data,
then so be it here too. It is not icky if you don't simply forget
(like you snipped) the reason I see ordering as tabular. We are
not doing fashion and trendy trends here are we?

What I am saying needs to be received with perspective. I am not
saying not to use <ol>s and to prefer tables. Rather, to not
shrink from tables where they do the job wanted and where it is
unsatisfactory to use <ol>s (as in the op's problem of this
thread).

--
dorayme
Mar 1 '07 #13

P: n/a
dorayme wrote:
An ordered list is really - in the heart of heart of things - a
table. The tabular data is thus: in the left col, is the order of
something while in the right col is the thing.
You are, in a way, sort of right. An ordered list is a special type of
two-column table, where one column is implied by the nature of the
beast. That is, there is a relationship between the numbering and the
content.

On the other hand you are entirely wrong. Many things in HTML can be
said to be /a type of/ something else. For example, an image is an
object, and a paragraph is a specialised block element. Yet, as with all
HTML elements, you should use the element that is most specific to the
task at hand.

So whilst you /could/ use a table for an ordered list, _in most cases_
there is already a *better* element that is more suitable for the task,
ie. the OL element. I do however agree that in cases like Shannon's,
where an ordered list simply won't cater for the job, a table is
probably the _logical_ element to use as you could explicitly create the
relationship between the numbering (which is going from 10 to 1) and the
text (which is in increasing order of importance depending on the
numbering).

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.
Mar 2 '07 #14

P: n/a
Dylan Parry wrote on 02 mrt 2007 in
comp.infosystems.www.authoring.stylesheets:
So whilst you /could/ use a table for an ordered list, _in most cases_
there is already a *better* element that is more suitable for the task,
ie. the OL element. I do however agree that in cases like Shannon's,
where an ordered list simply won't cater for the job, a table is
probably the _logical_ element to use as you could explicitly create the
relationship between the numbering (which is going from 10 to 1) and the
text (which is in increasing order of importance depending on the
numbering).
Perhaps OT in this NG:

<ol id='t'>
<li>qwerty
<li>asdfg
<li>zxcvb
<li>qwerty
</ol>
<script type='text/javascript'>
var t = document.getElementById('t');
var s = t.getElementsByTagName('LI');
for ( i=s.length-1; i>=0; i--)
s[i].value = s.length - i;
</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 2 '07 #15

P: n/a
In article <45*********************@news.gradwell.net>,
Dylan Parry <us****@dylanparry.comwrote:
dorayme wrote:
An ordered list is really - in the heart of heart of things - a
table. The tabular data is thus: in the left col, is the order of
something while in the right col is the thing.

You are, in a way, sort of right. An ordered list is a special type of
two-column table, where one column is implied by the nature of the
beast. That is, there is a relationship between the numbering and the
content.

On the other hand you are entirely wrong.
Only if one is to draw out of it a consequence that I had not at
all intended. See my remarks to Bergamot especially where I said
about "perspective"
Many things in HTML can be
said to be /a type of/ something else. For example, an image is an
object, and a paragraph is a specialised block element. Yet, as with all
HTML elements, you should use the element that is most specific to the
task at hand.

So whilst you /could/ use a table for an ordered list, _in most cases_
there is already a *better* element that is more suitable for the task,
ie. the OL element. I do however agree that in cases like Shannon's,
where an ordered list simply won't cater for the job, a table is
probably the _logical_ element to use as you could explicitly create the
relationship between the numbering (which is going from 10 to 1) and the
text (which is in increasing order of importance depending on the
numbering).
I entirely agree with your take on this. The whole point of mine
was that the nature of an ordered list does not preclude the use
of tables where <olfails to be up to the job.

Including mild stylistic aspects. Personally, I prefer:

9. N-KB5, P-QR3
10. P-R3, ...

to

9. N-KB5, P-QR3
10. P-R3, ...

Now, a consequence of what I was saying is that if it is easier
for someone to style a 2 col table to suit, they should not be
racked with guilt at using a table and not using an <ol>.

I hope there is not now some new way in which I am 'entirely
wrong'. <g>

--
dorayme
Mar 2 '07 #16

P: n/a
dorayme wrote:
Including mild stylistic aspects. Personally, I prefer:
[...]

I don't think I would personally condone using a table merely for
stylistic preferences such as that you gave in your example ;)
I hope there is not now some new way in which I am 'entirely
wrong'. <g>
I'm sure there probably is, but I'm not going to probe into finding it
(I'll leave that to you Martians).

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

The opinions stated above are not necessarily representative of
those of my cats. All opinions expressed are entirely your own.
Mar 2 '07 #17

P: n/a
On 2007-03-02, dorayme wrote:
....
Including mild stylistic aspects. Personally, I prefer:

9. N-KB5, P-QR3
10. P-R3, ...

to

9. N-KB5, P-QR3
10. P-R3, ...
Better still:

9. Nf5 a6
10. h3 ...

(Or is it a3? Descriptive notation is ambiguous; that's why
algebraic has been the standard for 30 years.)

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Mar 3 '07 #18

P: n/a
In article <45*********************@news.gradwell.net>,
Dylan Parry <us****@dylanparry.comwrote:
dorayme wrote:
Including mild stylistic aspects. Personally, I prefer:
[...]

I don't think I would personally condone using a table merely for
stylistic preferences such as that you gave in your example ;)
I think a lot of folk here, even if they agreed with the basic
idea we have been discussing, would not go so far either. In
this, I can only speculate, till I hear argument to the contrary,
that it is not wholly rationally based.

You know how emotional people get over tables! I remind you that
the example was of a two cell table, small cols. And I remind
Jonathan Little, who has nothing to do with this thread, that I
am not saying it could not be done with the numbering style I
like with <ol- he likes to show how anything can be done. He
hates tables, even for tabular data, but this rider he will not
admit publicly <g>

--
dorayme
Mar 3 '07 #19

P: n/a
In article <ij************@xword.teksavvy.com>,
"Chris F.A. Johnson" <cf********@gmail.comwrote:
On 2007-03-02, dorayme wrote:
...
Including mild stylistic aspects. Personally, I prefer:

9. N-KB5, P-QR3
10. P-R3, ...

to

9. N-KB5, P-QR3
10. P-R3, ...

Better still:

9. Nf5 a6
10. h3 ...

(Or is it a3? Descriptive notation is ambiguous; that's why
algebraic has been the standard for 30 years.)
I am old fashioned. It is only ambiguous if the writer does not
know what to look out for and avoid with well known ways.

9. N(Q4)-KB5, ...

and now it is fixed, only one piece at most can be on Q4

Just btw, I would prefer;

9. Nf5, a6
10. h3, ...

to your

9. Nf5 a6
10. h3 ...

which brings up another interesting point about the structure
itself, not just the style. Maybe a three col table would more
suit these chess ordered lists. From what I said to DP, I would
not hesitate at all if there was any advantage and I could be
bothered, my semantic conscience is clear you see...

--
dorayme
Mar 3 '07 #20

P: n/a
VK
On Feb 28, 9:09 am, "Shannon Jacobs" <Shannon.Jacobs.nos...@gmail.com>
wrote:
What I actually want is an ordered
list that counts down to one. Are negative increments even possible?
No negative and no 0 (zero) values are allowed in HTML, the lowest
value is 1 rendered as 1, I, i, ... depending on the chosen bullet
type. I mean of course the OL element itself, not a custom emulation
using other HTML elements.

For the countdown X to 1 you may use the behavior styling.

Note: All modern UAs are using "agressive rendering" (show the next
chunk as soon as you can) Such approach is not possible for countdown
because the first LI and the next LIs cannot be numbered until it's
known the total number of list items in the list. On slow connection
it may lead to a blink effect when the preliminary numbering is being
replaced by the actual one.

Demo: <http://jsnet.sourceforge.net/tmp/countdown.html>

Files: <http://jsnet.sourceforge.net/tmp/countdown.zip>

Mar 3 '07 #21

P: n/a
Okay, in that case "as soon as you can" has to include the scan to the
end of the <OLto get the count. That's pretty trivial overhead,but
if it really bothered you, you wouldn't want to use the feature.

Anyway, I suppose least inconvenient workaround with a suitable format
is the <DLwith the decrementing numbers included in the <DTparts.
For a countdown list, that won't be too hideous, with the <DD>
including the rationale/punchline for the entry.

On Mar 4, 1:39 am, "VK" <schools_r...@yahoo.comwrote:
On Feb 28, 9:09 am, "Shannon Jacobs" <Shannon.Jacobs.nos...@gmail.com>
wrote:
What I actually want is an ordered
list that counts down to one. Are negative increments even possible?

No negative and no 0 (zero) values are allowed in HTML, the lowest
value is 1 rendered as 1, I, i, ... depending on the chosen bullet
type. I mean of course the OL element itself, not a custom emulation
using other HTML elements.

For the countdown X to 1 you may use the behavior styling.

Note: All modern UAs are using "agressive rendering" (show the next
chunk as soon as you can) Such approach is not possible for countdown
because the first LI and the next LIs cannot be numbered until it's
known the total number of list items in the list. On slow connection
it may lead to a blink effect when the preliminary numbering is being
replaced by the actual one.

Demo: <http://jsnet.sourceforge.net/tmp/countdown.html>

Files: <http://jsnet.sourceforge.net/tmp/countdown.zip>

Mar 5 '07 #22

P: n/a
Considering this idea led me to the conclusion that it would be better
to generate the countdown list with explicit <li value=...tags,
which though deprecated, would at least look okay for my purposes.
However, unless my HTML editor included some kind of tool for that
purpose, it just seems easier to go with the <DLapproach mentioned
farther down in the thread...

However, it still bothers me that something as semantically obvious
and trivial as a countdown list was left out of the HTML standards...

On Feb 28, 4:29 pm, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit Adrienne Boswell:
This might help:http://www.w3.org/TR/REC-CSS2/generate.html

The theory is there, but
a) the CSS 2 recommendation is in practice obsolete and isn't even referred
to on W3C's pages on CSS when listing versions of CSS; the CSS 2.1 draft is
what we're supposed to use, although it says that it is an unstable draft,
mere "work in progress"
b) generated content does not work on IE (even IE 7)
c) marker properties, which would be needed for smooth implementation of the
idea of decrementing numbers as list markers, in addtion to being removed in
CSS 2.1, don't work on any browser, more or less.

The conclusion is that you should include the numbers as data (perhaps
generating them using some server-side technique) and probably use <ul>
markup with list-style-type: none. You might wish to put the numbers inside
some <spanmarkup in order to be able to style them; you may need to use
float: left in order to make those elements behave as block elements for
which you can effectively set the width property.

--
Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/

Mar 5 '07 #23

P: n/a
Scripsit Shannon Jacobs:
Considering this idea
Which idea? Your upside-down fullquoting suggests that you haven't read the
messages comprehensively, and you're not saying which idea you have
considered - you're responding to a message that mentioned several ideas.
led me to the conclusion that it would be better
to generate the countdown list with explicit <li value=...tags,
If that's your conclusion, then either premises or your logic is wrong.
However, unless my HTML editor included some kind of tool for that
purpose, it just seems easier to go with the <DLapproach mentioned
farther down in the thread...
Misrepresening a numbered list as a list of term/definition pairs gets you
nowhere with the original problem.
However, it still bothers me that something as semantically obvious
and trivial as a countdown list was left out of the HTML standards...
The basic problem is that HTML has two kinds of basic lists, <uland <ol>,
with no real semantic distinction. An <ollist is no more ordered than
<ul>, since browsers are surely not allowed to reorder a <ullist; <olis
just _numbered_. The distinction is expressible in CSS using the
list-style-type property.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Mar 5 '07 #24

P: n/a
On Mon, 5 Mar 2007 10:30:16 +0200, "Jukka K. Korpela"
<jk******@cs.tut.fiwrote:

>The basic problem is that HTML has two kinds of basic lists, <uland <ol>,
with no real semantic distinction.
I don't believe this is so. As I understand things the semanitc meaning
of UL is that "this is a list whose elements have no implied order" and
of OL it is that "this is a list whose elements have a defined order".

Tha CSS does not provide a rule to display such html in highest to
lowest order I see as a flaw of CSS, not of HTML.

Actually, for the case of a list that is to be displayed horizontally by
CSS youshould be able to reverse the display order by floating the list
elements right, though I have not actually tested this and it's a
side-issue anyway.

Hmm --- if the above is right then one might possibly be able to display
the elements vertically in reverse order by putting a "clear: left" rule
on the LI elements as well.

Otherwise I would still use the OL tag, but set the list-display-style
to "none" and place the ordering text in the html, possibly with a
graphic.
Mar 5 '07 #25

P: n/a
VK
On Mar 5, 7:05 am, "Shannon Jacobs" <Shannon.Jacobs.nos...@gmail.com>
wrote:
Anyway, I suppose least inconvenient workaround with a suitable format
is the <DLwith the decrementing numbers included in the <DTparts.
For a countdown list, that won't be too hideous, with the <DD>
including the rationale/punchline for the entry.
I thought you wanted auto-decrementing OL by CSS means, so like
default OL behavior but reversed. The posted demo shows how to make
it.
If you simply hardcoding numbers for list items and asking what HTML
element would be the most "semantically appropriate" for the
substitution then I would say the same OL with auto-numbering killed
and manual numbering added as SPAN.
The next is P with SPAN and TABLE
DL has really nothing to do with the job: list item content is not a
description of the item number.

Mar 10 '07 #26

This discussion thread is closed

Replies have been disabled for this discussion.