Numbering List - onizet/html2openxml GitHub Wiki
Numbering lists are ol
and ul
tags. Nested lists are supported, with a maximum of 8 depths (limitation of MS Word).
Those are the W3C list types supported.
- decimal
- disc
- square
- circle
- upper-alpha and lower-alpha
- upper-roman and lower-roman
- upper-greek and lower-greek
Alternatively, you can use the type attribute: <ol type="1|a|A|i|I">
Numbering on headings (i.e., 1.1, 1.2, 2.1, ...) are automatically detected and we apply a non-standardised list style: decimal-tiered
. You may also use this value on your lists.
To disable the detection on headings, turn this flag off:
converter.SupportsHeadingNumbering = false;
By default, the numbering continues between 2 consecutive lists.
If you want to reset the incremental of the next list -or- if you want to start on a defined value, you can use the attribute start
on the ol
tag.
<ol start="0"><li>Item</li></ol>
<ol start="50"><li>Item</li></ol>
To globally always reset the numbering, you can just opt-out this flag:
HtmlConverter.ContinueNumbering = false;
Tables inside a nested list are also aligned to respect the list hanging.
<ol>
<li>Item 1
<table><tr><td>Cell1</td></tr></table>
<ol>
<li>Item 1.1
<table><tr><td>Cell1.1</td></tr></table>
</li>
</ol>
</li>
</ol>
