Skip to main content
Inspiring
November 9, 2006
Question

Display blanks in cfoutput

  • November 9, 2006
  • 5 replies
  • 547 views
Hi,

I try to display blanks inside cfoutput tag.
For example , my database record contains 10 connected blanks.
But when I display this record the blanks are reduced to one.
I try to use #HTMLCodeFormat(string_with_blanks)# , but then the font is changed to courier.
Does anybody know a better solution to display all blanks?

regards
Claudia
    This topic has been closed for replies.

    5 replies

    biene22Author
    Inspiring
    November 10, 2006
    Okay, I use the replace() function and it works.
    Thanks!
    November 9, 2006
    HTMLCodeFormat() does not change the font to courier. You can use any font you want.
    HTMLCodeFormat () DOES wrap the output in <pre> tags -- which force fixed width formating. This is what you need to display space/tab formatted text.

    Otherwise, use   as jdeline suggests.
    November 9, 2006
    This is a HTML issue. Use a Replace( ) function to replace each occurrence of a blank (Chr(32)) with  
    biene22Author
    Inspiring
    November 9, 2006
    Hi Dan,
    for example my datarecord looks like
    <cfset string=" Teststring with many blanks">

    <cfoutput>#string#</cfoutput>
    shows string as:

    Teststring with many blanks

    The blanks between the words "with" and "many" are not shown.
    Inspiring
    November 9, 2006
    What's a connected blank?
    What do you want displayed exactly?