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:

<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>


.bodymatter a::after { content: leader('.') target-counter(attr(href url), page, decimal) }

Result expected:

> Introduction..........1 
> Chapter One...........2
  • Presumably, you're trying to generate a PDF? If so, that syntax isn't supported. I don't think you can do page numbers like that in the PDF renderer, it's simply not powerful enough to do that. – sfdcfox Aug 15 '20 at 12:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.