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 13 of 13
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    word wrap difficulties

    I am trying to send textarea contents to a new page, but the contents are coming across in one line. How can I get it to wrap so that the user can print out the new page?

    I have tried including wrap=hard in the textarea definition, but only Netscape seems to recognize it.

    Isn't there something I can do to the formatting of the new page (it's dumping into a table cell) to make it wrap?

  • #2
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since no one has responded yet, I guess no one knows. How 'bout I get more specific?

    I found the following IE css extension:
    http://msdn.microsoft.com/workshop/a...s/wordwrap.asp

    But I can't figure out how to use the darn thing! (CSS is not my strong suit...)

    I tried using it for the <td> both in the header:

    td {word-wrap:break-word}

    and in the element itself:

    <td style="word-wrap:break-word">

    still no wrapping.

    Can someone help me out here?

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Delaware, USA
    Posts
    137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you doing it server-side when you said you're sending textarea content to the printable page or client-side via javascript?

    Also, could you post the code you're using as the table before you fill it with the textarea content? maybe it's as simple as defining a width/height for the table/table cell? It should automatically wrap unless you tell it not to.

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by tamienne
    Are you doing it server-side when you said you're sending textarea content to the printable page or client-side via javascript?
    client-side via javascript

    maybe it's as simple as defining a width/height for the table/table cell?
    Yep, I had forgotten to put in the width for the table and cell. I did that, and now it works. (But see below.)

    It should automatically wrap unless you tell it not to.
    Do you mean it should do this in both IE and Netscape? For IE, it only works on the PCs that have 5.5, which supports the new extension I referred to above. For Netscape, I still seem to have to put in the wrap=hard in the textarea definition.

  • #5
    New Coder
    Join Date
    Aug 2002
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Has anyone figured out a result to this?? I have the same issue and wrap=hard, wrap=soft, wrap=virtual just don't work.

    Dia

  • #6
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I figured it out, but I had to use two different methods for Netscape and IE.

    Netscape did not recognize the wrap=hard, so I set a hard column width.

    IE did not recognize the hard column width, but it did recognize the wrap=hard.

    So I have to have both in my HTML file.

    P.S. I also did testing with Mozilla. I believe it behaved, oddly enough, the same as IE.

  • #7
    Regular Coder
    Join Date
    Sep 2002
    Posts
    454
    Thanks
    0
    Thanked 20 Times in 20 Posts
    try wrap=physical
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #8
    New Coder
    Join Date
    Aug 2002
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts
    dremmers....

    Could you please post an example of what worked for you with IE and Netscape 6.2? I have tried setting wrap=hard, wrap=physical, and so forth with no luck with Netscape.

    Thanks,
    Dia

  • #9
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Glad you made me look at it, because I gave you WRONG INFORMATION! Looks like I did not use wrap=hard. I used the css property "word-wrap". Here is the documentation, it only works in IE (I have IE 5.0 Mac): http://msdn.microsoft.com/workshop/a...s/wordwrap.asp The table width definition is all Netscape needs (I have 4.78). I also test with Mozilla 5.0. I can't remember which it recognizes, but it works with my current setup. Here is the code:

    <html>
    <head>
    <title>My Story</title>
    <STYLE type="text/css">
    <!--
    td {
    word-wrap:break-word
    }
    // -->
    </style>
    </head>
    <body>
    &nbsp;

    <table width="640">
    <tr>
    <td width="72">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

    <td width="568">
    <h1>
    My Story</h1>

    Here is the text that is really long and should wrap. Here is the text that is really long and should wrap. Here is the text that is really long and should wrap. Here is the text that is really long and should wrap. Here is the text that is really long and should wrap. Here is the text that is really long and should wrap. Here is the text that is really long and should wrap. Here is the text that is really long and should wrap. Here is the text that is really long and should wrap. Here is the text that is really long and should wrap.

    </td>
    </tr>
    </table>
    </body>
    </html>

    Hope this helps...

  • #10
    New Coder
    Join Date
    Aug 2002
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts
    dremmers...

    There's the difference. I'm trying to do it with a <TEXTAREA> form field where in the example you've provided you're doing it with just a table cell. I may try the css property with the <TEXTAREA> tags to see if it works there too.

    Thanks,
    Dia

  • #11
    Regular Coder
    Join Date
    Jun 2002
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts
    DiaH

    I've just installed Netscape 7, and am coming to the conclusion that this browser will not wrap in a text area if the text doesn't have a white space, such as in a url. No problem with regular text (with 'wrap' in there) but a long url just will not wrap like IE or older Netscapes did.

    Now if you find a solution, could you please post. I, like yourself, tried everything to get a url to wrap, but to no avail...

    Thanks,

    PauletteB

  • #12
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    DiaH, what is it exactly that you are trying to do?

    I am using a form that sends results to a new page (which is what I posted) after clicking process (which runs a perl script). The form itself does include a textarea. The text area is defined with wrap=hard. The table is just where the results of the text area are being placed on the results page.

    To see the whole thing in action and how I did it, it might be easier for you to visit my web page: http://www.mylifestory.org . Click on "Write My Story", and then click the "Select a Random Question" button. This pulls up a form with the textarea defined as mentioned above. Once you have filled out the form, click "Process". You will be taken to a results page, and the formatting SHOULD be good.

    Let me know how it goes.

  • #13
    New Coder
    Join Date
    Aug 2002
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't get it!!! I swear I tried wrap=soft, wrap=hard and had nothing work!! After viewing your example, Dremmers, I tried again b/c it obviously worked for you. I do it again and it works. ugh ugh ugh....

    Thanks!!


  •  

    Posting Permissions

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