html/web guru, I need to word wrap preformated text..

aceO07

Diamond Member
Nov 6, 2000
4,491
0
76
I have a web app that allows people to enter records. One of the fields is a description field. I want to be able to display the description field as the user has typed it. It should keep all the spacings and line returns. I can do this with the pre tag. I noticed that it didn't word wrap, so I added in the css for white-space pre-wrap. This works great on the webpage, but is horrible when it prints. When it prints, it cuts on the text that gets word wrapped. The printed version only shows as much of the line as possible on a single line, but doesn't continue or word wrap.

How do I get this to print properly.
 

aceO07

Diamond Member
Nov 6, 2000
4,491
0
76
I'm using ruby on rails. I'll take a look into converting that text, though I was hoping that the browsers would be able to handle printing it properly if it was displaying on the screen properly. It doesn't print what's on the screen, even if the screen got cut off. The remainder of the line, which does start on the next line does not get printed.

edit. I managed to convert that text. But still, it's just silly that the browser doesn't do it!
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
I believe printing has a different style markup then display. I'm pretty sure you can specify one CSS markup for display, and one CSS markup for printing; although I haven't used it in several years. Last time I used it was for an Intranet site written in classic ASP.