Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Web Design & Development
Tag Cloud
access audio black screen blue screen bsod connection crash desktop drivers dvd email error excel excel 2003 firefox google hard drive hardware hdmi hijackthis internet itunes keyboard laptop malware monitor motherboard network networking outlook problem ram recovery router screen slow sound spyware tdlwsp.dll trojan vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Forcing long text lines to wrap

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
msage's Avatar
Junior Member with 3 posts.
 
Join Date: Jul 2004
Experience: Intermediate
13-Jul-2004, 01:38 PM #1
Question Forcing long text lines to wrap
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 <pre> </pre> 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's Avatar
Distinguished Member with 27,127 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
13-Jul-2004, 02:08 PM #2
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

<pre style="
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
white-space: pre-wrap;
word-wrap: break-word;
">

This should work with most browsers.
__________________
izme: You know...it's kind of nice to sit atop Civilized debate and look down below on all of the uncivilized master debating we are here...just out of the fight zone

Gibble: Now you know what it's like to be Canadian.
msage's Avatar
Junior Member with 3 posts.
 
Join Date: Jul 2004
Experience: Intermediate
13-Jul-2004, 05:08 PM #3
That works!!
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's Avatar
Distinguished Member with 27,127 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
13-Jul-2004, 06:18 PM #4
Quote:
Originally Posted by 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.
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's Avatar
Junior Member with 3 posts.
 
Join Date: Jul 2004
Experience: Intermediate
14-Jul-2004, 09:51 AM #5
Thanks again!!
I appreciate your information.
Gibble's Avatar
Distinguished Member with 27,127 posts.
 
Join Date: Oct 2001
Location: Striking or Scoring
Experience: The Alpha and Omega
14-Jul-2004, 09:53 AM #6
No problem
Closed Thread Bookmark and Share

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:51 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.