Like most Org users, I was aware of orgtbl-mode
. It’s a minor mode that brings the power of the Org mode table editor to other modes. Because just about everything I do that might require a table gets done in Org mode, I never paid very much attention to it. I envisioned it as an easy way of generating ASCII tables like
| Date | Item | Cost | |------------+-----------+-------| | 2014-03-14 | Book | 12.95 | | 2014-05-01 | Batteries | 7.50 | | ... | | |
in, say, an email or some other non-Org file.
It turns out, though, that Orgtbl mode is much more powerful than that. For example, all the spreadsheet functions are there so I could have added a Total row to the above table and had the costs summed automatically. That still doesn’t exhaust the power of Orgtbl, however.
Here’s a two minute video that shows how powerful it can be. You add a comment with the Org style table in it, put another comment where you want the table to appear in your source code, press 【Ctrl+c Ctrl+c】 and the table is added to your file in HTML. If you write a lot of HTML that has tables in it, this can be a real time saver.
Orgtbl has built-in conversion engines for HTML, LaTeX, and texinfo. The manual gives some hints on writing your own if you have special needs.