Skip to main content
Participant
July 4, 2008
Question

output of query gives unwanted whitespace

  • July 4, 2008
  • 2 replies
  • 814 views
Hi

A client asked to create a small application in CF. I have no experience with cf and now I have a problem.

I'm querying a database and I want to put the results of the query on screen. Inititally I used the cfoutput tag to output the entire query to the screen, but it gives me a white space between the different records. I don't want that since it's html code that I'm putting on the screen.
I also tried looping through the query myself with cfloop and then use the output tag

How can I prevent the white space between the different records ?

thx !
This topic has been closed for replies.

2 replies

Inspiring
July 4, 2008
What html tags are you talking about? Unless your data has trailing spaces, this will work.

<cfoutput query="your_query">
#your_field#
</cfoutput>
Inspiring
July 4, 2008
Your post does not have enough detail. How does your data appear now, and how would you like it to appear?
Participant
July 4, 2008
quote:

Originally posted by: Dan Bracuk
Your post does not have enough detail. How does your data appear now, and how would you like it to appear?


It gives me part1 part2 part3 and what I want is part1part2part3 , so without the space in between them.

The problem is that if a html-tag is seperated over 2 parts that it will be outputed with a space and so it won't be interpretated as a HTML-tag.
Inspiring
July 5, 2008
can you give more details on how you save your data to the database? anyway, have you tried trimming the space?

<cfoutput query="your_query">
#Trim(your_field)#
</cfoutput>