These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:06 pm Advanced search

Suggestion: ORDER attribute for OL's

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

Suggestion: ORDER attribute for OL's

Postby Siemova » Tue Jan 08, 2008 10:01 pm

I recently wanted to create an OL in reverse order. In scouring the web for a solution, I found no simple way to accomplish this, but came across a number of other people frustrated by the lack of this minor feature.

The easiest, most obvious solution would be to create an attribute for Ordered Lists -- let's call it order="" -- which would have two possible values: ftl (first to last) and ltf (last to first). Very much like the dir property for text, and, similarly, it would default/degrade to the normal first-to-last order.

The possible applications for this are numerous, of course: count-downs, top n lists, having "most recent" items at the top of a reverse-numbered list, etc. I'm sure anybody can think of times they'd want to do this. It would be particularly helpful for traditional print (newspapers, magazines, etc.) converting their content for internet use. Yes, you can accomplish such things via overloaded tables or CSS hacks, or avoid using an HTML list at all, but my proposal would make this use of lists much more convenient, more standardized, and less likely to break.
Siemova
<h6>
 
Posts: 4
Joined: Tue Jan 08, 2008 8:59 pm
Location: Texas

Re: Suggestion: ORDER attribute for OL's

Postby zcorpan » Wed Jan 09, 2008 12:57 am

Siemova wrote:[...] but came across a number of other people frustrated by the lack of this minor feature.
Interesting, do you have any pointers to your findings?
Siemova wrote:[...] Yes, you can accomplish such things via overloaded tables or CSS hacks, or avoid using an HTML list at all, [...]
Do you know any pages that do this today?
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby Siemova » Wed Jan 09, 2008 4:29 pm

zcorpan wrote:Interesting, do you have any pointers to your findings?


Here's one. This and this are more incidental, but here we have a thread dedicated to it -- a prime example of all the hacks people are reduced to for this simple effect. I also saw a number of other attempted threads or pleas on blogs which never even got answered because nobody knew how to solve the problem.


zcorpan wrote:Do you know any pages that do this today?


In addition to the thread linked above, here's another example of a CSS hack, and another. Then here's a guy who had to write a JavaScript to re-order his lists. Also, I read another thread in which someone talked about using tables:
"Although `content1' may seem to contain capricious markup, I have found that this table setup best represents a radio group reverse ordered list across multiple browsers. I have been trying to do that without tables, but cross browser presentation is not consistent."

And, of course, there's the ubiquitous non-HTML list.

I could keep going, but that should be more than enough to give you the idea. Many people want to do this. There may be several potential solutions, but few people know what they are, none of them works in every case or even every browser, and all of them appear to overload markup not intended for that purpose.
Siemova
<h6>
 
Posts: 4
Joined: Tue Jan 08, 2008 8:59 pm
Location: Texas

Postby zcorpan » Wed Jan 09, 2008 4:56 pm

Awesome. Thanks!

I've forwarded this to the list: http://lists.whatwg.org/pipermail/whatw ... 13578.html
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby Siemova » Wed Jan 09, 2008 5:28 pm

Very much appreciated. :) I know it's not a huge deal, but this could definitely prove handy on occasion. Good thing I'd been reading about HTML5 and the WHATWG recently, or I wouldn't have had any idea where to propose it!
Siemova
<h6>
 
Posts: 4
Joined: Tue Jan 08, 2008 8:59 pm
Location: Texas

Postby zcorpan » Tue Feb 26, 2008 12:34 pm

zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest