Emacs: Edit Tables
What is ASCII Table
This lets you to generate text drawing of tabular data.
Then you can edit it interactively, such as insert or delete column.
You can also convert it to HTML or LaTeX format.
Create a New Empty Table
To create a table,
Alt+x table-insert
The result look like this:
Press Tab or Shift+Tab to go to neighbor cells.
Create a Table from Comma Separated Values (CSV)
table-capture
- convert a text of tabular data into ASCII table.
Let's say you have this comma separated values:
,A,B,C 1,1a,1b,1c 2,2a,2b,2c 3,3a,3b,3c
Select the whole text, then Alt+x table-capture
. It'll ask you these questions:
- Column delimiter regexp. Answer: ,.
- Row delimiter regexp. Answer newline, by typing Ctrl+q Ctrl+j.
- Justify. Type one of {left,center,right}.
- Minimum cell width. This is the number of chars per cell. Type 5 for example.
Emacs will then change it to this:
Using Table Menu
Once you have created a table, you can use the menu to do things. The menu [Table] will appear when your cursor is on a table cell.
Show All Table Commands
Alt+x
apropos-command
,
then type
^table-
sample of useful ones:
table-insert-row
table-insert-column
table-delete-row
table-delete-column
table-release
→ output to space separated values
Export Table to HTML
table-generate-source
-
convert ASCII table under cursor to HTML LaTeX or CALS format.