Click to See Complete Forum and Search --> : problem formatting plain text


webtekie
10-13-2006, 08:02 PM
Hi guys,

I am trying to display data from MySQL database. The field type is longtext and it contains data that was converted from Excel to CSV. In Excel data concisted of three paragraphs, in database those three paragraphs are showing correctly. Howerver, when I display data in HTML all formatting is lost and there are no paragraphs. I tried using nl2br() but it does not work. Does it mean that data had wrong formatting in Excel in the first place? Any suggestions?

thanks,
webtekie

NogDog
10-13-2006, 08:52 PM
Try wrapping the output in HTML <pre>...</pre> tags, perhaps?

webtekie
10-13-2006, 09:51 PM
Yeah, I did that but the problem is that all paragraphs have 4-5 sentences and so <pre> tag doesn't wrap these paragrpahs and thus this makes page wider than it should be. I tried to put <pre> in table and set specific width for table - doesn't work.