emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: "Gustav Wikström" <gustav.erik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: TABLES: Remove/add cell
Date: Fri, 30 Sep 2011 20:22:20 +0200	[thread overview]
Message-ID: <CALn3zoh6o+zjbMckWhHYWnAGL+0jUsCGY+tAnCdyCw2-dyDoMQ@mail.gmail.com> (raw)
In-Reply-To: <CA+SyOP9TsAfJ1A9u3aSeqRbqXr+Fo+W3_Uj1w-Mv4Bzg1MSLWw@mail.gmail.com>

Hi Gustav

Ehm - it is doable, but not by editing commands from Org table. Only
with several rectangular edits or an Org table formula with a few
tricks and a temporary column to be removed afterward. Probably not as
comfortable as you have expected:

- insert row in only one column
  start with:
  | a | 1 |   |
  | b | 3 |   |
  | c | 4 |   |
  | d |   |   |

  | a | 1 | 1 |
  | b | 3 |   |
  | c | 4 | 3 |
  | d |   | 4 |
  #+TBLFM: @1$3=$-1::@3$3..@>$3=subscr(@2$2..@>>$2, @# - 2)

- remove again
  start with:
  | a | 1 |   |
  | b |   |   |
  | c | 3 |   |
  | d | 4 |   |

  | a | 1 | 1 |
  | b |   | 3 |
  | c | 3 | 4 |
  | d | 4 |   |
  #+TBLFM: @1$3=$-1::@2$3..@>>$3=subscr(@3$2..@>$2, @# - 1)

See the Calc manual for "subscr" and the Org manual for "@#" and the rest.

If it does not work (e. g. org-version 6.33) then upgrade.

Michael

2011/9/30 Gustav Wikström <gustav.erik@gmail.com>:
> How do I add or remove a single cell in a table?
> Example:
> I have the following table:
> |        1 |        1 |
> |        2 |        3 |
> |        3 |        4 |
> |        4 |          |
> Now I want to add an empty cell in @2$2 (below the heading) and thus move
> the following cells in column 2 down one step.
> After:
> |        1 |        1 |
> |        2 |          |
> |        3 |        3 |
> |        4 |        4 |
> Is this doable?

  reply	other threads:[~2011-09-30 18:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30 17:38 TABLES: Remove/add cell Gustav Wikström
2011-09-30 18:22 ` Michael Brand [this message]
2011-09-30 18:50   ` brian powell
2011-09-30 19:27     ` Gustav Wikström
2011-09-30 19:06   ` Michael Brand
2011-11-23 19:13     ` Michael Brand
2011-11-24 12:57       ` Daniel Martins
2011-12-11 16:41         ` Bastien
2011-12-11 17:21           ` Achim Gratz
2011-12-11 17:39             ` Bastien
2011-12-11 16:42       ` Bastien
2011-12-18 16:18         ` Michael Brand
2011-10-01  9:40   ` suvayu ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALn3zoh6o+zjbMckWhHYWnAGL+0jUsCGY+tAnCdyCw2-dyDoMQ@mail.gmail.com \
    --to=michael.ch.brand@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gustav.erik@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).