# Forcing long text lines to wrap



## msage

Our company has rolled it's own problem management program (using Lotus Domino I think).

Editing text in the status area works fine. But, displaying the text is a different thing. If the user allows the text to wrap in the edit box, the whole sentence/paragraph is displayed on one line that extends beyond the right side of the window.

I've pointed out that this does not look right and asked if it was going to be fixed. The developer pretty much agreed that it's not right but, he can't figure out how to fix it. His solution was to tell the users to insert linefeeds right before the right side of the edit box.

I've viewed the source of the generated web page. Tables are used to handle the layout. The long text entry is wrapped in tags.

My question is: Is there a way to force long lines of text to wrap?

I have to believe there is (via Javascript possibly). Unfortunately, I'm just learning HTML. The searches I have done on the web have turned up at least one item that might resolve this. Unfortunately, the entry is on a site that requires a paid subscription.


----------



## Gibble

Your developer can't fix it?

Geesh...time for a new developer!

in the css, give the pre tag these attributes
pre {
white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
white-space: -pre-wrap; /* Opera 4 - 6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
word-wrap: break-word; /* IE 5.5+ */
}

or in the HTML in the pre tags style attribute put

This should work with most browsers.


----------



## msage

Thank you!!

A couple things though:

1) Can you tell me where those values (i.e. -moz-pre-wrap) are defined? I tried searching on www.w3.org and got a little frustrated (I work on big iron--we don't use no stinkin' fancy-smancy web browsin' do-dads. .

2) Can the width be modified? I imagine it can be.


----------



## Gibble

msage said:


> Thank you!!
> 
> A couple things though:
> 
> 1) Can you tell me where those values (i.e. -moz-pre-wrap) are defined? I tried searching on www.w3.org and got a little frustrated (I work on big iron--we don't use no stinkin' fancy-smancy web browsin' do-dads. .
> 
> 2) Can the width be modified? I imagine it can be.


1) A lot of those like -moz-pre-wrap are browser specific, that's why there are so many, there isn't a w3 standard 'yet' ...

2) The width can be modified in the style by adding width: 50%; to it (or whatever % or absolute value.


----------



## msage

I appreciate your information.


----------



## Gibble

No problem


----------

