• Post Reply Bookmark Topic Watch Topic
  • New Topic

Keep Tabs & Spaces  RSS feed

 
Dave Donohoe
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the FileReader & BufferedReader classes to read in a text file & display it in the the brower.
This works fine except that tabs & spaces get left out ie text in the file like this so the start of a new paragraph does not have the tab in front of it that it does in the file.

How can I keep the tabs & spaces format of the text file?
[ March 31, 2002: Message edited by: Dave Donohoe ]
 
Steve Deadsea
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enclose the text in <pre> tags. Such as
<pre>
This is the text.
</pre>
 
Dave Donohoe
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve! That worked perfectly!
D
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!