Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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 !.

share|improve this answer
    
Thanks, that looks like a good start. The RegExp is what I need. –  Ocaso Protal Mar 1 '13 at 7:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.