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

Preserving White Space in HTML

Status
Not open for further replies.

lucknowm

MIS
Jun 4, 1999
19
0
0
US
Is there a way to preserve white spaces ( blanks, tabs etc.) in HTML.

I am using print statement in Perl to read lines from a file and print them as follows :

while ( <INP_FILE> ) {
chomp;
printf &quot;\n$_ \n&quot;;
printf &quot;<br>&quot;;
}

But when the page is rendered, multiple blanks are replaced by a single blank, tab is replaced by blank etc.

abhay
 
One problem,

the page is now showing blank line after every line

abhay
 
dont know much perl, but is it because this line has two new lines in it, one at the beginning and end.
Code:
printf &quot;\n$_ \n&quot;;
hope it helps

&quot;Those who dare to fail miserably can achieve greatly.&quot; - Robert F. Kennedy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top