Skip to content
doubtly

2 answers

Inside <pre>, simply type the spaces (or tabs) you want; the browser keeps them exactly.

Normally HTML collapses several spaces into one. The <pre> (preformatted text) tag displays text in a monospace font and preserves all spaces and line breaks:

<pre>
Name      Marks
Asha      85
Ravi      92
</pre>

Here the extra spaces between the columns appear on the page as typed. The CSS margin property only adds space around the whole pre block, not between words inside it. The same effect can be given to any element with CSS white-space: pre;.

Doubtly AI · 24 Oct 2026 AI-verified · Oct 2026 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.