www.webdeveloper.com
Results 1 to 4 of 4

Thread: two level ordered list?

  1. #1
    Join Date
    Aug 2004
    Posts
    249

    two level ordered list?

    Can we have two or three level listing using <OL> or something like that?

    an exmple of output:
    PHP Code:
    1. Item one
    2. Item two
        2.1
    Item two  point one
        2.2
    Item two point two
    3. Item Three
    4. 
    and so on 
    as far as I know using <OL> we can only create a simple numbering but not for example 2.2 and 2.3.

    I was wondering if there is a tag that can do that for us?
    G - M - B - E - P

  2. #2
    Join Date
    Mar 2004
    Posts
    3,056
    Of course you can. You can nest as many as you need. You can mix and nest ol's ul's dl's and all sorts.

  3. #3
    Join Date
    May 2005
    Posts
    63

    Ordered List types

    Unfortunately the types for ordered lists are 1 (numbered), A and a (alphabetical), and I or i (roman numeral). There is no tag that I am aware of that allows a list type of 1.1 (number and decimal).

    However, you can nest ordered lists and use an alternate type for the nested lists:

    Code:
    1. Item 1
       A. Sub-item 1.A
    2. Item 2
       A. Sub-item 2.A
    etc.
    Code:
    <ol type="1">
     <li>Item 1
      <ol type="A">
       <li>Item 1-A</li>
      </ol>
     </li>
     <li>Item 2
      <ol type="a">
       <li>Item 2-a</li>
      </ol>
     </li>
     <li>Item 3
      <ol type="I">
       <li>Item 3-I</li>
      </ol>
     </li>
     <li>Item 4
      <ol type="i">
       <li>Item 4-i</li>
      </ol>
     </li>
    </ol>
    Last edited by wayne_ca; 06-19-2005 at 06:47 PM.

  4. #4
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    Eventually this sort of thing will come into play but for now it's best to generate that on the server side.
    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles