1

I inserted the following table:

+-----+-----+-----+ | | | | +-----+-----+-----+ | | | | +-----+-----+-----+ | | | | +-----+-----+-----+ 

I then entered some data into a cell, which caused the columns to become misaligned:

+-----+-----+-----+ | Type | | | +-----+-----+-----+ | | | | +-----+-----+-----+ | | | | +-----+-----+-----+ 

The Org manual says that I can re-align the columns automatically by pressing TAB, RET and C-c C-c inside the table, but none of these work for me.

When I try C-c C-c, I get the following message:

Use 'C-c `' to edit table.el tables

But when I try 'C-c `', I get an error message:

Not at a table

This post on Stackoverflow describes the same problem, but none of the suggested solutions worked for me.

I have only been using Emacs for a couple of days, so I'm not sure where to go from here. I'm using Emacs 29.4 on Windows 10. Any guidance would be greatly appreciated.

1 Answer 1

2

In the context of Org, a table typically means an Org-table. This type of table is what Org users use for formula (=*TBLFM*) and stuff. And it is these types of tables that you can do automatic align with TAB etc.

What you have with you is a table.el table. And table.el is a totally different library, and pre-dates Org-'s org-table.el library.

TLDR: What you have is a donkey (=table.el), and mistaking it for a horse(=org-table.el) you are doing horse stuff with the donkey. Horses and donkeys look alike, but they aren't the same.

  • This is a table.el table
+-----+-----+-----+ | | | | +-----+-----+-----+ | | | | +-----+-----+-----+ | | | | +-----+-----+-----+ * This is an `Org` table |---+---| | | | |---+---| | | | |---+---| | | | |---+---| * How to tell them apart? An `org`-table begins and ends with a `|` (= `pipe` character). A `table.el`-table may start and end with non-pipe characters. 

Editing table.el table in `Org' mode

In an Org-mode, I entered M-x table-insert, and inserted the below table. Subsequently, I did C-c ' to edit the table.

From Packages that Org cooperates with (Hint: See towards the end of the page)

table.el by Takaaki Ota

Complex ASCII tables with automatic line wrapping, column- and row-spanning, and alignment can be created using the Emacs table package by Takaaki Ota. Org mode recognizes such tables and exports them properly. C-c ' to edit these tables in a special buffer, much like Org's code blocks. Because of interference with other Org mode functionality, Takaaki Ota tables cannot be edited directly in the Org buffer.

  • C-c ' (org-edit-special): Edit a table.el table. Works when point is in a table.el table.

  • C-c ~​ (org-table-create-with-table.el): Insert a table.el table. If there is already a table at point, this command converts it between the table.el format and the Org mode format. See the documentation string of the command org-convert-table for the restrictions under which this is possible.

Editing table.el table in `Org' mode

5
  • I see, thank you for the link to the table.el source. The comments there mention that table.el tables re-align dynamically as content is typed into them, but that is not the case for me. I have used M-x table-fixed-width-mode to make sure that fixed-with-mode is disabled. Commented Dec 31, 2024 at 5:32
  • Updated my earlier response with a screnshot and a link to manpage. Commented Dec 31, 2024 at 9:26
  • I'm so sorry, I had been trying C-C ` (backtick) instead of C-c ' (apostrophe)! Thank you for the link to the man page, the screenshots and your patience :) Happy New Year! Commented Dec 31, 2024 at 10:03
  • 1
    Since the answer seems to have answered your question, please accept it. Commented Dec 31, 2024 at 14:53
  • 2
    Sorry @NickD, it slipped my mind. I have accepted it now. Commented Jan 1 at 0:40

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.