Log in

View Full Version : Resolved Dual Numbering Ordered List



bluewalrus
03-30-2010, 05:05 PM
Is there a way to have 2 line items as one line item? For example:


<ol>
<li>Step 1.</li>
<li>Step 2.</li>
<li>Step 3.</li>
<li>Step 4.</li>
<li><li>Steps 5 & 6.</li></li>
<li>Step 7.</li>
</ol>

djr33
03-30-2010, 05:28 PM
I have no idea, but I doubt it.

You could do that, though, using a table, (lots of) divs, or perhaps even an unordered list using complex CSS to append the number(s).

bluewalrus
03-30-2010, 07:57 PM
Those methods all involve static numbering though none where I could remove one step and the others are numbered correctly still, right?

A example of this usage in the future, from past code:


<ol>
<li>Step 1.</li>
<!-- <li>Step 2.</li>-->
<li>Step 2(3).</li>
<li>Step 3(4).</li>
<li><li>Steps 4(5) & 5(6).</li></li>
<li>Step 6(7).</li>
</ol>

I think it may not be possible this way just wondering. How could I use css to append the UL?

djr33
03-31-2010, 12:37 AM
My suggestions above are various methods to research, not necessarily useful approaches. I'm not sure how to best accomplish this.

If you want this: 1. 2. 4. (where "3." is simply missing), then I suggest just giving certain <li>s a class of "hide" with the CSS for that class set to display:none.

If you want something more like 1. 2. 3/4. then that will be more complex and I'd suggest just looking at the ideas above or coding it with a table/etc. You could create a function in PHP (or possibly Javascript) that could generate a "special numbered list".

EDIT:
I just did a google search for controlling the number of an ordered list and this page was one of the results:
http://www.w3.org/TR/html401/struct/lists.html
Look at some of the details partway down the page.
One interesting option is the 'value' parameter: <li value="5"> should set that number specifically to 5.

bluewalrus
04-01-2010, 02:48 AM
Oo okay thanks. Those all seem to be single values though I guess it's not possible via OL/UL's.