2

I have a table like this using Org mode (by typing |-- and then tab to complete

|-- Item-- |--Notes---|
| blah blah|blah blah |

Now I would like to add another column just before Item and contains checkbox. This is so that I can go down the table and check which item I have done. I know another way to do this is via a simple todo list. However, I would like to know how to do this via table.

In other words, I want:

|--Check--  |-- Item-- |--Notes---|
|  [    ]   | blah blah|blah blah |

And so on and so forth. I would like to be able to do C-c-C-C on [ ], as I move down the column and it would check X in the box.

In contrast to the example above, my actual table is very long (around 7 columns and 15 rows)

1 Answer 1

1

To insert a column on the left, start with the cursor on the first column, then press M-S-right (followed by M-left depending on the version you're using).

AFAIK there's no checkbox support in tables the way you're used to, so here's a command that toggles the presence of a "checkbox" in the current cell and moves down one row.

(defun check-cell ()
  (interactive)
  (let ((cell (org-table-get-field)))
    (if (string-match "[[:graph:]]" cell)
        (org-table-blank-field)
      (insert "X")
      (org-table-align))
    (org-table-next-row)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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