Formatting text area

Reply

Join Date: Jul 2007
Posts: 110
Reputation: Taffd is an unknown quantity at this point 
Solved Threads: 1
Taffd Taffd is offline Offline
Junior Poster

Formatting text area

 
0
  #1
Dec 30th, 2007
I've just been reading a solved thread with this same title. The solution was nl2br. I was unaware of this function and have been using str_replace instead.

A problem arises however, when converting preformatted text, specifically a table. Either solution leaves a mass of space between text and a table due to all the new lines generated.

Is there a solution to this.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 142
Reputation: MitkOK is an unknown quantity at this point 
Solved Threads: 12
MitkOK's Avatar
MitkOK MitkOK is offline Offline
Junior Poster

Re: Formatting text area

 
0
  #2
Dec 30th, 2007
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 110
Reputation: Taffd is an unknown quantity at this point 
Solved Threads: 1
Taffd Taffd is offline Offline
Junior Poster

Re: Formatting text area

 
0
  #3
Dec 30th, 2007
Thanks MitkOK, you've done it again.
My problem arose because I only have a text area for input. Consequently I formatted the output from my database with the str_replace equivalent of nl2br.
However, I already had a preformatted article in the database which contained a table. I got around the problem by updating the database, so that the table code was all on the same line.

I assume I'd have to use the trim function only on table code?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC