Obsidian recently updated their markdown spec to require a blank line before tables. I already try and avoid tables in Obsidian due to the poor interface, but this further compounds my dislike for them with how it negatively effects the visual appearance of my notes.
To help mitigate this I’ve created the following CSS to hide the blank line above tables. The blank line is still needed in the raw note, but this CSS will hide it within the live preview interface.
Simply add this code to your CSS Snippets folder, enable it, and the blank lines should now be hidden.
The blank line in source serves a purpose in markdown so this can cause issues for some people (which is why it has become an automatic addition iiuc). Better to have a way to just hide the blank lines in the render.
To that end, @Samo’s solution did the trick (Thank you!). I have not yet had time to look at catching the line after as yet, but I imagine it’s relatively simple, so I’ll take a look later
Thank you for your css snippet, it works great.
Do you know how to do it for the obligatory empty line after a blockquote?
I would like to hide the blank line after a blockquote.
I too have been frustrated with the limitations of markdown tables and over the years have seen people create many (unsatisfactory) solutions - which always fall short of the ideal - in Obsidian and LogSeq both. However, I think Obsidian tables have come a long way - what with support for live prevew and line breaks - they almost feel like standard HTML tables (similar to Anytype). Here’s to hoping they will support bullets some day.
One of the drawbacks I have seen with tables in a lot of apps is their uninspring look (Trilium for instance - which otherwise has excellent table support).
Find below a good, clear and uplifting look-and-feel for tables (with your snippet added at the bottom):