Reputation: 37681
I need to embed a huge text file in plain text which contains a lot of information organized by newlines, tabulations and spaces. This text file does not have any html tags, it's just plain text.
I need to show it embedded into an HTML file, because I don't want to write thousands of tags (<br>
, etc...) to reorganize the text, because if I just paste the plain text into a <b>
tag into an HTML file, the text is shown as a only paragraph without newlines, spaces and tabulations. I'm not sure how to do this. I can't find any info about that.
Upvotes: 0
Views: 817
Reputation: 1091
Contents in a <pre>
tag will make use of new lines, white space, and tabs.
If you need the letters to line up on top of each other like in a command line, you're wanting a "fixed width" font. You can take a look a the <tt>
tag, or you'd have to set the font for that block to a fixed-width font (which would be a different question)
Upvotes: 3
Reputation: 1662
The HTML spec requires a block level (or in the case of <br>
, an artificially line-breaking) tag to break lines. It specifically ignores line breaks and white space in the source, so if you want your raw text to keep its line breaks, find or write a script that converts the \n character to something that causes line breaks.
Upvotes: 0