How can I turn on Line Wrap when editing a table or in source view mode
I’m in love with Obsidian. BUT, I’ve run into what seems to me like it ought to be a very simply problem to fix, but I can’t find a solution.
I have some tables where the “Notes” column is pretty long. It’s easy to read when viewing the table. But when I try to edit that entry, whether by clicking on that particular line in the live editor or by switching to source mode, the line does not wrap. I have to painfully scroll left and right to try and get to the part of the entry I want to edit.
I’m a new obsidian user, and I’m sure I’m missing something very simple. Isn’t there a simple switch somewhere that would turn on line wrap when I’m in source mode, or when I’m editing a particular line?
Thank you
This isn’t something that Obsidian natively supports, but it’s pretty easy to do using CSS snippets. I will warn you though, long tables with wrapping cause confusion regarding which column you’re actually editing. That being said, here’s how to do it.
- Open
settings > Appearance and scroll to the bottom. Find the heading labeled CSS snippets and click on the little folder icon to open your snippets folder.
- Create a new text file and rename it to
table-wrap.css (be sure to delete the existing file extension otherwise this won’t work).
- Open the
.css file and copy the below code into it. Save the file and return to Obsidian.
- Click the refresh icon, then click the switch next to
table-wrap to turn it on.
Hope this helps
/*
Cribbed from the excellent ITS Theme
https://github.com/SlRvb/Obsidian--ITS-Theme
*/
.cm-s-obsidian .HyperMD-table-row.HyperMD-table-row.HyperMD-table-row {
white-space: pre-wrap;
min-width: min-content;
}
Perfect!
Thank you, that is what I needed!