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

<pre> tag Need to use to preserve text out put to html

Status
Not open for further replies.

wrighterb

Programmer
Feb 20, 2007
80
US
I have this code being looped over (1500 results)

<pre><a href="#">#currentElement#</a></pre>

__________________________________________________

The data comes out preserved but with extra line.

3456 678 x1z
- "I don't want this extra line"
45622 35 4 ylz
- "I don't want this extra line"
34315315 66 Ylz
- "I don't want this extra line"
34315315 66 Ylz
- "I don't want this extra line"
34315315 66 Ylz

I want them to come out like this.

3456 678 x1z
45622 35 4 ylz
34315315 66 Ylz
34315315 66 Ylz
34315315 66 Ylz

Is there some kind of style to stop the extra line break after the first result?

Me


 
Are you doing this with a script?
Can you put a pre tag before and at the end (only one pre tag)?
That all I've got for now
 

<cfloop 1 to 1500>
<pre><a href="#">#currentElement#</a></pre>
</cfloop>

So it runs through my database pulls out 1500 hundred results.

 
Try getting your <pre> tags out of the loop. Wrap the entire loop results in the tags instead.


Paul

 
This is a stab, but it seems like you could play with the margins of the <pre> tag with CSS.

I'll do a quick test. BRB, don't cry.

[monkey][snake] <.
 
Set you margin:0px on the pre element in your CSS. That will work.

[monkey][snake] <.
 
This is code for what I stated above:

Code:
<style type="text/css">
pre {
   margin:0px;
}
</style>

Turns out that BOTH margin-top and margin-bottom have to be set to 0px to remove the spacing.
Without both specified, no space at all is removed from between the <pre> tags.

[monkey][snake] <.
 
Yes that did work!!!!

Thanks you Margin 0 did the trick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top