Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wrapping text in Table of Contents

    I am building an e-learning lesson in Lectora that will be deployed to a SCROM compatible learning management system. The lesson is converted into HTML before that happens. My table of contents is around 100 pixels wide but some of the page names are longer than that and do not display fully when viewed in a browser.

    What I am trying to do is this:

    The page name for this page is very, very long and I can't see it all. Blah blah

    Would become

    The page name for this page is very,
    very long and I can't see it all. Blah blah

    I've been led to believe there is javascript that will do that.

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,148
    Thanks
    39
    Thanked 506 Times in 500 Posts

    Lightbulb

    Try one or the other of these two possible solutions.

    Note, there is no JS used in this particular solution...
    Code:
    <!DOC HTML>
    <html>
    <head>
    <title> Untitled </title>
    <!-- From: http://www.codingforums.com/newreply.php?do=postreply&t=237333 -->
    <style type="text/css">
    #TOC  { width:100px; border:1px solid blue; }
    #TOC2 { width:120px; height:120px; overflow:scroll; border:1px solid blue; }
    </style>
    
    </head>
    <body>
    <div id="TOC">
    The page name for this page is very, very long and I can't see it all. Blah blah
    </div>
    <p>
    You could also do it in a scrolling &lt;div&gt; region.
    <div id="TOC2">
    The page name for this page is very, very long and I can't see it all. Blah blah
    <br>
    <em>I have added some extra text that can only be seen if you scroll the area.</em>
    </div>
    
    </body>
    </html>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •