You need to sign in to do that
Don't have an account?
Pooja Bhatt 3
Page numbers in tables of contents should be generated automatically
I am using Visualforce page and i want table of content(index) with page number.
i am using the below code but i am not getting page number.
or is there any other way to do the same?
in vf page for index:
<nav>
<ol>
<li class="bodymatter "><a href="#intr_01">Introduction</a></li>
<li class="bodymatter"><a href="#chap_01">Chapter One</a></li>
</ol> </nav>
vf page with content:
<h1 id="intr_01"> Introduction</h1>
<p>some logic</p>
<h1 id="chap_01"> Chapter One</h1>
<p>some logic</p>
CSS:
.bodymatter a::after { content: leader('.') target-counter(attr(href url), page, decimal) }
Result expected:
Introduction.........1
Chapter One...........2
i am using the below code but i am not getting page number.
or is there any other way to do the same?
in vf page for index:
<nav>
<ol>
<li class="bodymatter "><a href="#intr_01">Introduction</a></li>
<li class="bodymatter"><a href="#chap_01">Chapter One</a></li>
</ol> </nav>
vf page with content:
<h1 id="intr_01"> Introduction</h1>
<p>some logic</p>
<h1 id="chap_01"> Chapter One</h1>
<p>some logic</p>
CSS:
.bodymatter a::after { content: leader('.') target-counter(attr(href url), page, decimal) }
Result expected:
Introduction.........1
Chapter One...........2
Your CSS looks correct, this is what we use for our doc-gen product Weaver:
Which looks pretty much the same, so might just be due to what I mentioned earlier with loading in CSS as a seperate file from say, Static Resources.
Result expected:
Introduction.........1
Chapter One...........2