If you’re just trying to create a horizontal line, then you can just add --- into your note and it gets rendered as a horizontal rule that is formatted based on the theme for your vault. It sounds like you may be trying to do something else, though, so the rest of my response is geared toward that.
Markdown from Edit mode gets rendered into HTML in Preview mode. HTML does not keep white space unless you go out of your way to keep it.
Depending on what you’re doing, using a code block might be a good solution. In my vault, I find that inserting a certain number spaces before a word automatically changes the format to a code block, but I’m not sure whether that is intended behavior.
You could also add your own custom styling to your notes by either editing the CSS for your theme or adding your own CSS snippet. For example, I entered this into a note:
<div class="my-test">
Text
</div>
Then I entered this into my theme’s CSS file:
.my-test {
text-align: center;
}
The result is that “Text” is centered in Preview mode. Of course, you would replace the style with the formatting you are trying to achieve.