7

How can I quickly strike-through every element of a row in a table in org-mode?

For example if I have the following table:

| h1    | h2    | h3    | h4     |
|-------+-------+-------+--------|
| foo   | bar   | baz   | bazong |
| lorem | ipsum | dolor | sit    |

I want to get this

| h1    | h2    | h3    | h4       |
|-------+-------+-------+----------|
| +foo+ | +bar+ | +baz+ | +bazong+ |
| lorem | ipsum | dolor | sit      |

Without manually adding a '+' at the beginning and the end of every cell.

1 Answer 1

5

If you put the point at the beginning of the line you want to strike through, you can use the following replace-regexp to strike through all the contents

C-M-%      ;; Query-regexp-replace
" +\(.+?\) +|" RET " +\1+ |"  ;; Strikethrough all content up to the next |

Then only do so for the length of that line (If you select the line first you can perform on the entire region with !.

1
  • Thanks, that looks like a good start. The RegExp is what I need. Mar 1, 2013 at 7:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .