Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unexpected blank lines 1

Status
Not open for further replies.

plook

IS-IT--Management
Apr 1, 2000
33
Hi !!

I got a problem with blank lines. What I mean is that I get a few blank lines on a page but there are no <BR> tags. Well, there are some, but only 2 or 3 maximum but I get 10 or 15 blank lines. Here is a copy of what my code looks like..
---------------------
... a few CFQUERY Tags are here...

<html>
<head>
<title>Title</title>
</head>
<BODY>
<CFSET DEFAULT_CURRENCY = &quot;USD&quot;>
<CFSET DEFAULT_LANGUAGE = &quot;1&quot;>
<CFSET DEFAULT_MARKUP = &quot;100&quot;>
<CFOUTPUT>
<CFSET shipping_charge = #find_customer.shipping_charge2#>
</cfoutput>
<CFOUTPUT><B><font size=+1 color=&quot;000000&quot;>Price List for #dateFormat(Now())#,#TimeFormat(Now())#</font></b></CFOUTPUT><BR>
<font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#000000&quot;>
<CFOUTPUT query=&quot;find_salesperson&quot;>
BLA BLA BLA<br>
BLA2 BLA2 BLA2<bR>
<form action=&quot;form&quot; method=&quot;post&quot;><input type=&quot;hidden&quot; name=&quot;_mode&quot; value=&quot;sendmail&quot;><input type=&quot;hidden&quot; name=&quot;_subject&quot; value=&quot;Subject&quot;><input type=&quot;hidden&quot; name=&quot;_email&quot; value=&quot;#find_salesperson.email#&quot;><input type=&quot;hidden&quot; name=&quot;_back&quot; value=&quot;value&quot;>
</cfoutput>
<table border=&quot;0&quot;><col width=&quot;180&quot;><col width=&quot;200&quot;><col width=&quot;90&quot;> <col width=&quot;90&quot;>
<CFIF URL.cat4 IS NOT &quot;no&quot;><tr><td><B>PC133 168pin</b></td><td></td><td></td><td><TD></td>
</tr>

----------------------------------------

Which CF code generates the following HTML code...

---------------------------------------
<html> <head> <title>Title</title> </head> <BODY> <B><font size=+1 color=&quot;000000&quot;>Price List for 02-Feb-01,10:16 AM</font></b><BR> <font face=&quot;arial&quot; size=&quot;2&quot; color=&quot;#000000&quot;>
BLA BLA BLA<bR>
BLA2 BLA2 BLA2 <bR>
<form action=&quot;form&quot; method=&quot;post&quot;><input type=&quot;hidden&quot; name=&quot;_mode&quot; value=&quot;sendmail&quot;><input type=&quot;hidden&quot; name=&quot;_subject&quot; value=&quot;subject&quot;><input type=&quot;hidden&quot; name=&quot;_email&quot; value=&quot;email&quot;><input type=&quot;hidden&quot; name=&quot;_back&quot; value=&quot;value&quot;> <table border=&quot;0&quot;><col width=&quot;180&quot;><col width=&quot;200&quot;><col width=&quot;90&quot;> <col width=&quot;90&quot;> <tr><td><B>PC133 168pin</b></td><td></td><td></td><td><TD></td> </tr>
------------------------------


There is nothing really funky in this code.. but the browser (either IE 5.x or Netscape) puts about 15 Lines between &quot;BLA2 BLA2 BLA2&quot; and the first row of the table.

Any ideas where these lines could come from ?? And it seems like the more CFQUERY tags I put before the <HTML> tag, the more blank lines I get !!!!

Thanks for your help (and for your patience to read my post up to here ;)))

Dominic
 
Hi Plook,

Certain tags in CF will generate unwanted line breaks. You can use the <cfsetting> tag to prevent these. If you put this in your code,

<cfsetting enablecfoutputonly=&quot;yes&quot;>

CF will return everything between cfoutput tags exactly as you have it coded. All dynamic loops and outputs will process normally but anything outside of <cfoutput> tags including normal html will not be sent back. You can turn this on and off within the template like this.

<cfsetting enablecfoutputonly=&quot;yes&quot;>
<cfoutput>....</cfoutput>
<cfsetting enablecfoutputonly=&quot;no&quot;>

This will prevent extra lines around the CF tags that cause them but allows all regular html to be sent back normallly.

Good luck,
GJ
 
You rock GJ !!

Thanks !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top