0

I'm trying to set a column width in an org-mode table, but using the syntax isn't working. Here's my table:

| col 1 | col 2 with quite a long header | col 3 here |
|-------+--------------------------------+------------|
|       |                            <5> |            |
| abc   |                            123 | x          |
| def   |                            456 | y          |

I'd expect that after a re-align, the second column would be displayed with a width of 5 -- but it stays the way seen above. I'm not exporting this file, I just want to narrow the usually-displayed column so my table is easier to read.

Any ideas why org isn't displaying the width correctly?

Dan Drake
  • 503
  • 2
  • 15

1 Answers1

3

Normal realign with C-c C-c does not consider column widths (anymore?, idk). Use C-c TAB (org-table-toggle-column-width) instead to shrink or expand the current column. To narrow all columns with a specified width call it with a prefix argument C-u C-c TAB. To automatically shrink columns with a width cookie you can either set #+STARTUP: shrink on a per-file basis or org-startup-shrink-all-tables to t to do it globally.

fpiper
  • 451
  • 2
  • 2
  • The org documentation (https://orgmode.org/manual/Column-width-and-alignment.html) says " The next re-align will then set the width of this column to this value." It seems that's wrong; does the documentation need to be updated? – Dan Drake Nov 08 '19 at 21:29
  • This page in the org documentation in my emacs (Org version 9.2.6) is different from the online one. But both say they are manuals for Org version 9.2. It may be that this was just recently changed. – fpiper Nov 09 '19 at 13:10
  • See [STARTUP value no longer narrow table columns](https://code.orgmode.org/bzg/org-mode/src/master/etc/ORG-NEWS#L559) and [Dynamically narrow table columns](https://code.orgmode.org/bzg/org-mode/src/master/etc/ORG-NEWS#L661) N.B. The links include line numbers in the file which are going to change - if they are wrong, please search for the titles instead. – NickD Nov 09 '19 at 16:06