Jump to content

Recommended Posts

Hi all,

 

Is it possible to generate from php to html and word a table of contents like this:

 

Test Case 1793: Fresh Install.........................4

Test Case 1795: Upgrade from 6.0.0.120..........5

Test Case 1797: Language Option...................5

Test Case 1799: Registration..........................5

 

I need this because I am generating a report to html and word I have no problems with html it does not need the pages. But in ms-word I need the pages.

I hope anyone can help or tell me if this is possible.

 

Thanks,

Jj

 

Link to comment
https://forums.phpfreaks.com/topic/98768-table-of-contents-question/
Share on other sites

Its possible, but it's going to require you choosing a font where all characters have the exact same width (unlike the one on this site - if you look, the numbers don't line up correctly in your example). You set a number of characters for the width, then count the number of characters in the title and the number of characters in the page number, add them together, and subtract them from the width. This will give you the number of periods to input in between the title and the page number.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.