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!

Display Issue 2

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
Is there anyway to make the html display a hard break without a <br>. I am inputting data from a db and it looks like:

this is the
text that I am
inputting from
a db.

I want it to look as if it was this:

this is the<br>
text that I am<br>
inputting from<br>
a db.<br>
 
I don't think that there is a way to do this. If you don't use a tag like <br> or <p></p> the text will appear in the browser as one single line.

Why don't you want to use <br>?


Cheers

frag

patrick.metz@epost.de
 
You could surround it with <pre> tags, but that will change the font to courier as well.

Otherwise, you'll have to scan your text as you extract it and replace all occurences of the line break character with a <br>. I can't be more specific without knowing more about your database and the code you're using to deal with it.

-- Chris Hunt
 
<pre> works beautiful... just put a style to it and that corrected the font issue... thanks man
 
what r u using? ASP or PHP? there may be another method...

Known is handfull, Unknown is worldfull
 
Hm... I guess I did not got the problem... I thought you wanted a linebreak without having to use any tags at all...

patrick.metz@epost.de
 
Star for Chris. I think <pre> definitely is the right tag for this task. <br> would add more tags than necessary and jumble the code. If the database text displayed is for example customer info, you could even use <pre class=&quot;customerinfo&quot;> and then in your stylesheet use pre.customerinfo{font-family:sans-serif;}

Cheers,
petey

News and views of some obscure guy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top