I use a standard org-mode table to store a lot of my own personal data. However, the tables have gotten quite large.

I need a way to have the top row stay visible.

Can I set this with header-line-format or something similar?

2 Answers 2


This question on stackoverflow has two suggestions, including using elisp to set the header-line-format to the first line of the table.

It also suggests splitting the window horizontally and keeping the header in the upper window as a hackish workaround.

To use the code, add it to org-mode-hook as follows

(add-hook 'org-mode-hook (lambda()
  (setq-local header-line-format
    (list '(:eval
          (org-table-goto-line 1)
          (substring (thing-at-point 'line t) 0 -1)))))))
  • I read that question, but how do I set it for each different document? Each header will be at a different line for each document with a table. Dec 9, 2015 at 1:57
  • 1
    @Adam Which method are you using? The code should recognize which table you're in and do the right thing.
    – user2699
    Dec 10, 2015 at 0:24
  • @usere2699 I tried to paste the code from the post you linked into my .init.el but nothing is different when I go into a file with an org-table and scroll past the header. I'm running emacs from the OS X terminal if that makes any difference. Dec 10, 2015 at 6:31
  • 1
    @Adam, copying it into your init file won't do much (as you found), it has to be called when org-mode is started. I've added an example.
    – user2699
    Dec 10, 2015 at 21:48
  • ah! Thank you! I see the header-line now but when I scroll down past the header of my table nothing appears in the header-line. Dec 11, 2015 at 4:17

There is a package on Melpa that may be useful: orgtbl-show-header

  • Please provide a little more information on the package and a link.
    – Dan
    May 1, 2016 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.