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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

row spacing in <pre> text output 1

Status
Not open for further replies.

rogere

Technical User
May 17, 2001
3
AU
I'm outputting a preformatted report. Character spacing is all important. When the single field to be output is wrapped in <pre>. ie. <pre>#PrintLine#</Pre>, the rows in the output whether CFOUTPUT or CFTABLE are at least double spaced. Any idea how to overcome this, or of better alternatives ?

Thanks.
 
Hey Rogere,

There are a few things you can try. Each displays a little different depending on the text inside.

This is the easiest #ParagraphFormat(PrintLine)# This converts carriage returns to <p> paragraph markers.

the other way is to
#Replace(PrintLine,Chr(10),&quot;<b>&quot;,&quot;ALL&quot;)#

Also
#Replace(PrintLine,Chr(10)+Chr(13),&quot;<b>&quot;,&quot;ALL&quot;)#

These will act a little different and will depend somewhat on what system it is on. Unix uses only CHR(10) and windows uses chr(10)+chr(13) so you may need to play with that to get it working correctly.

Should be a start though.
Have Fun
 
tlhawkins:

I'm not having trouble with carriage returns or line feeds within the text string. Your suggestions made no difference to the output.
The field I'm trying to display is a char(140) field from a sql table which contains formatted report output, 1 line per record, with fields aligned using spaces. The field contains no control characters. <pre> gives me the right formatting left to right with a fixed pitch font, but I get what looks like double spacing between each of the output records.
I'm looking for a way to get each output line(row) to print close to the next one without the excessive row spacing.

Thanks....
 
Hmmm...

Is this being output in a table? You mentioned <CFTABLE... has it been tried with no formatting around it? The only time I've seen text formatted like that it was because of table settings (like Valign=Center) . I would love to see what happens if you cut and paste that text. Does it still keep it's double spacing?

some things to think about.
 
tlHawkins:

It's fixed. It was an HTML issue. Wrapping each output line in <pre> </pre> caused the extra spacing.
I just wrapped the whole <CFTABLE> </CFTABLE> in one pair of <pre> </pre> tags and got the formatting I was looking for.

Your &quot;..... no formatting around it&quot; rang a bell.

Thanks very much for your help.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top