Show column and row lines in tables (default theme)

Things I have tried

Checked through settings and can’t see an option. I can turn it on when using minimal theme, but not default.

What I’m trying to do

I’m just trying to show row and column outlines on dataview tables, when using the default theme, but I can’t see an option anywhere to turn this on.

I have searched through the forum for an answer but I can’t see one - sorry if there is one and I missed it.

Is it possible to show all the outlines for tables in while using the default theme? Any custom snippet for this? (I wouldn’t know where to start)

Thanks!

You could make your own snippet like the following:

  • Go to Settings > Appearance > Css snippets, and hit the folder icon on the far right. This opens the snippets folder in your file explorer
  • Add a file like tableOutlines.css into this folder, and add the following contents:
    .dataview.table-view-table :is(td, th) {
      border: 1px solid;
    } 
    
    .dataview.table-view-table th {
      border-bottom: 3px solid;  
    }
    
  • Back in Obsidian, go back to Settings > Appearance > CSS Snippets, and hit the enable button next to your file tableOutlines.css (or whatever you called it)

And now you should have a single pixel border around all cells in dataview tables, with a little more prominent line between the header row and the other cells. Feel free to adjust to your hearts desire.

3 Likes

Thank you very much! That’s perfect.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.