Need to generate ol li in Document template

0
Hi , I need to generate increment for sub li element in document template like below:-      1. Products.             1.1 Clothes             1.2 Accessories             1.3 Footwear I am able to generate the data like below ,But i want data like above,  1.  Products.     1. Clothes     2. Accessories     3. Footwear I tried adding some additional styles, Like below:- ol { counter-reset: item } li{ display: block } li:before { content: counters(item, ".") " "; counter-increment: item } and  ul.numeric-decimals { counter-reset:section;list-style-type:none; } ul.numeric-decimals li { list-style-type:none; } ul.numeric-decimals li ul { counter-reset:subsection; } ul.numeric-decimals li:before{ counter-increment:section; content:counter(section) ". ";/*content:"Section " counter(section) ". ";*/ } ul.numeric-decimals li ul li:before { counter-increment:subsection; content:counter(section) "." counter(subsection) " "; }  but it is not working in Document Template.  Looking for some suggestions. Thanks in advance
asked
1 answers
2

Hi Heena,

You can use counters to do so. The following style sheet numbers nested list items as "1", "1.1", "1.1.1", etc.

The Simple Example:

ol { counter-reset: item }
li{ display: block }
li:before { content: counters(item, ".") " "; counter-increment: item }
<ol>
  <li>Products
    <ol>
      <li>Clothes</li>
      <li>Accessories</li>
      <li>Footwear</li>
    </ol>
  </li>
  <li>Products - 2</li>
  <li>Products - 3
    <ol>
      <li>Clothes</li>
      <li>Accessories</li>
      <li>Footwear</li>
    </ol>
  </li>
</ol>

 

answered