RE: [PHP] Formatting text

From: Date: Sun, 29 Dec 2002 16:13:46 +0000
Subject: RE: [PHP] Formatting text
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-129584@lists.php.net to get a copy of this message
> I have to put results of various departments in our school website. All > results will go in the Mysql database. The problem is formatting the > output. I have output something like this where the numbers shown are > student marks : > > Quote > > Passed with Grade A : > Adm nos : 8177 9822 1750 0059 > > Passed with Grade B : > Adm nos : 6614 8375 0837 1647 5490 3758 7388 7799 > > Passed with Grade C : > Adm nos : 9968 0298 1297 1254 4208 4911 6194 9903 > > Unquote > > I made a multiline textboxes and used PHP script and input this in a > LONGTEXT field in MySQL. Then I used PHP to output this field in a > webpage. The formatting, carriage return, tabs etc are lost. Formatting is > very essential in this document for us. Your problem is that HTML does not recognize newline or tab characters. The easy fix is to just surround the line by <pre> which will cause the newline and tab elements to show up. The hard fix, but nicer looking one, is to output your data in a table. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#129584) next »