Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Getting Started / December 2005



Tip: Looking for answers? Try searching our database.

Internet Explorer <PRE> Tag

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rcain37 - 28 Dec 2005 15:36 GMT
I have a  SQL Database that has a memo field that contains paragraphs of
information.  These paragraphs where copied from html pages and pasted into
each field, so they lost there formatting.  

I can use the <PRE> tag with a set width and Netscape Navigator makes the
paragraphs appear like they are suppose to but Internet Exporer doesn't use the
width and sends each paragraph clear across the screen.  This would make a user
with IE scroll to their right until they get to the end of each paragraph.  

Does anyone know a fix for this?  I have tried some CSS and setting table
widths but I can't get IE to cooperate with me.  Most of our users use IE.

Here is the code I have for the output.  The txt field is the memo field and
with the Pre tag it appears correct in Netscape but not in IE.  

<cfoutput query="getcode">
<strong>#SectionHead#</strong><br>
<pre width="100">#txt#</pre>
</cfoutput>  

Thanks
Umbrae - 28 Dec 2005 15:43 GMT
Hmmm, I believe IE is using PRE properly according to the HTML specs, which
should do as you have indicated. As such, I would find another way around this.
If you are only worried about carriage returns you could always convert
standard line feeds (either Chr(10) or Chr(13): I always get them reversed) to
<BR>'s. Then you can just display it as HTML and if should display with proper
wrapping.
Rcain37 - 28 Dec 2005 15:51 GMT
There are approximately 28,000 memo fields in this database.   Could I do what your talking about in the output or would I have to replace 13 spaces in the database with a <br>?
Umbrae - 28 Dec 2005 16:00 GMT
You can either do the process as it is coming out or going in. In your case, it
may be easier to do it on the output....

<cfoutput query="getcode">
<strong>#SectionHead#</strong><br>
#Replace(txt, Chr(10), "<BR>")#
</cfoutput>
Rcain37 - 28 Dec 2005 16:07 GMT
Hey Umbrae,
Thank you sooooooo much.  The Replace worked awesome and I would have never figured it out.  If knew who you were I'd owe you a beer.

Thanks
Umbrae - 28 Dec 2005 16:12 GMT
My pleasure.

Just mark my answer as the solution (should be a link at the bottom of every post), and then drink one for me on New Years. :)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.