monsieur_jj Posted March 31, 2008 Share Posted March 31, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/98768-table-of-contents-question/ Share on other sites More sharing options...
haku Posted March 31, 2008 Share Posted March 31, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/98768-table-of-contents-question/#findComment-505462 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.