2

I like how org-mode allows me to quickly create and edit tables. However, I do not like the table's appearance and I would like to modify it.

Customizing the face only lets me change foreground and background color. I want to change the grid only. The essence of this question was asked about 8 years ago here. Did anything change since then?

I also tried to solve this by font-locking the "|" (pipe/bar) character, however, it seems that my regular expression does not find it reliably and does not set the face.

(add-hook 'org-mode-hook
          (lambda ()
            (font-lock-add-keywords 'org-mode
                                    '((" | " .
                                       'font-lock-keyword-face)))))

So my question is: Can I hide the grid in org-mode tables?

  • If I inspect font-lock-keywords in an org buffer I find ("^[ ]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)" (1 'org-table t)) twice. You probably have to overwrite this somehow. (" | " (0 font-lock-keyword-face t)) didn't work for me. It's probably overwritten with org-table again. Check this question, maybe it helps: emacs.stackexchange.com/a/40654/19819 – Hubisan Apr 29 at 16:28
  • Just so I understand this piece of code correctly: font-lock is already set in org-buffers with a regular expression searching for tables and setting the whole group (1) to the face 'org-table, right? And you tried to overwrite it, but that did not work. BTW, I managed to hide the |-characters by using pretty-symbols-mode and setting space as an replacement. However, this changes the |-character, I would just like to show it in a different color. – jollaWellbuur May 2 at 11:20
  • Exactly. For some reason sometimes it started to work. But didn't find out why. So it probably is doable. – Hubisan May 2 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.