org-table-header-line
mode is designed to show the headings of the table when they would otherwise be invisible . It is a minor mode, so you can turn it on the usual way you enable or disable any minor mode: M-x org-table-header-line-mode
toggles the mode interactively. From Lisp, (org-table-header-line-mode 1)
turns it on and (org-table-header-line-mode 0)
turns it off footnote. Then when you are looking at a portion of the table near the bottom, making the top of the table (in particular, the line with the table headings) scroll off the top of the window, the top line of the window is overlaid with the line of the table headings, so you can see in which column you are on.
For example, in the following screenshot, you can see that the cursor is in column F
(the table that this came from has 40 rows and the columns are various powers of the row number):
I mistakenly stated in my comment and in the previous version of this answer that this takes advantage of an Emacs facility, called the header-line
(which is like the mode line, except it's at the top of the window, instead of the bottom - in particular, you control it by using the variable header-line-format
, similar to how the mode line is controlled with the variable mode-line-format
). But the implementation of org-table-header-line-mode
does NOT use the Emacs header-line
at all. Mea culpa.
[footnote] Actually any positive argument enables it and any negative (or zero) argument disables it - just like all minor modes.
C-h v header-line-format
). I believe thatorg-table-header-line-mode
is supposed to take advantage of that, but I cannot make it work and I don't feel like debugging ATM. If you (or anybody else) can make it work, then that would be one answer to this question.org-table-header-line-mode
works in my Emacs (v29.3, Kubuntu), and is fantastic! Please feel free to post your comment as an answer.org-table-header-line-mode
is great, I'm just discovering it. @NickD, it also works well on Arch (GNU Emacs 29.3, Org mode 9.8-pre).header-line
: it does not. Instead, it adds a function to thepost-command-hook
that checks for the proper conditions and overlays the table header string on the top line of the window. See the heavily revised answer below.