How to Change Ordered Lists Layout and Styles
How to Continue Numbering in Ordered Lists
Ordered lists (
<ol>) typically begin numbering at 1 in XHTML output.
However, in certain situations you may need to start at a given index. You can control the
starting number using the @outputclass="start-x" attribute (where X is the
number you want the list to start with) on the <ol> element. This is
especially useful when lists do not have the same
parent:<table frame="all">
<title>Table with nested order lists</title>
<tgroup cols="1">
<tbody>
<row>
<entry>
<ol>
<li>First Item</li>
<li>Second Item</li>
</ol>
</entry>
</row>
<row>
<entry>
<ol outputclass="start-3">
<li>Third Item</li>
<li>Fourth Item</li>
</ol>
</entry>
</row>
</tbody>
</tgroup>
</table>How to Change Numbering Styles for Ordered Lists
Ordered lists (
<ol>) are usually numbered in
XHTML output using numerals. If you want to change the numbering to alphabetical, follow
these steps:- Define a custom
@outputclassvalue and set it as an attribute of the ordered list, as in the following example:<ol outputclass="number-alpha"> <li>A</li> <li>B</li> <li>C</li> </ol> - Add the following code snippet in a custom CSS
file:
ol.number-alpha{ list-style-type:lower-alpha; } - Reference the CSS file in a WebHelp Responsive
transformation using an Oxygen Publishing Template or the
args.cssparameter.
Referencing the Custom CSS from a Publishing Template
- If you have not already created a Publishing Template, see How to Create a Publishing Template.
- Using the Project view, copy your custom CSS in a folder inside the publishing template root folder (for example, in the custom_footer_template/resources folder).
- Open the template
descriptor file associated with your publishing template and add your custom
CSS in the resources
section.
<publishing-template> ... <webhelp> ... <resources> ... <css file="resources/MyCustom.css"/> - Open the DITA Map WebHelp Responsive transformation scenario.
- Click the Choose Custom Publishing Template link and select your template.
- Click OK to save the changes to the transformation scenario.
- Run the transformation scenario.
Result: Your custom CSS will be applied as a final layer on top of any existing CSS rules and the output will reflect the changes you made.
Referencing the CSS Using the args.css Parameter
- Edit the DITA Map WebHelp Responsive transformation scenario and open the Parameters tab.
- Set the
args.cssparameter to the path of your custom CSS file. - Set the
args.copycssparameter toyesto automatically copy your custom CSS in the output folder when the transformation scenario is processed. - Click OK to save the changes to the transformation scenario.
- Run the transformation scenario.
Result: Your custom CSS will be applied as a final layer on top of any existing CSS rules and the output will reflect the changes you made.