Support checkboxes in tables

Definitely need this. I’m having to fake it with css and embedded html is far from pleasant.

1 Like

Hi hello!

I’d love to see this implemented as well.

2 Likes

I ran into a case where i need to mark notes to keep track and making MOCs. Using dataviewjs i can do this. However the checkbox will be cleared once load a new page, need to pin the dataview note and open marked note into new tab.

dv.table(["File"], 
    dv.pages('"Main/Permanents"')
        .where(b => cond_f(b.file.name))
        .where(b => check_orphan(b.file.inlinks))
        .sort(b => b.file.inlinks.length, 'desc')
        .map(b => ["- [ ] " + b.file.link]).limit(LIMIT))

More or my function implementation for someone curious :smiley:

const LIMIT = 99999

const cond_arr = [
    "SR -", "OP -", 
    "PL -", "TS -", "BO -", "VC -",
    "HS -", "HCO -",
    "CO -", "HMOC",
    "MOC -", "MH -"
]

function cond_f(filename) {
    for (const idx in cond_arr) {
        const cond = cond_arr[idx]
        if (filename.toUpperCase().startsWith(cond))
            return false
    }
    return true
}

function check_orphan(inlinks) {
    // console.log(JSON.parse(JSON.stringify(inlinks)))
	// console.log(JSON.parse(JSON.stringify(inlinks)).values.length)

    const arr = JSON.parse(JSON.stringify(inlinks)).values
    let count = 0
    for (let i = 0; i < arr.length; i++) {
        const f = arr[i]

        if (
            f.path.toUpperCase().includes("BO - ")
            || f.path.toUpperCase().includes("MH - ")) {
                count += 1
            }
    }

    if (count == inlinks.length)
        return true

    return false
}

Yes, checkboxes-in-tables is the best feature of AirTable, imo (although I stopped using AirTable because of its other limitations…)

3 Likes

This feature is definitely missing!

1 Like

Missing it too.
But you could use also symbols: &#9744; for “☐” and &#9746; for “☒”
There is also cute &#9745; for “:ballot_box_with_check:”, but I can’t find its unchecked pair…

I can’t get any of the css solutions to work. Would love if there was some native support for this feature

+1 for this feature to be supported.

In the mean time I came up with this janky way to do this with no css:

  1. Dowloaded the check and uncheck icons from icons8.com
  2. Moved them to the attachments folder in my obsidian vault (you can add it if you do not already have this directory)
  3. Renamed them to checked and unchecked for easier editing
  4. Added them to my table
| Level |                         |                         |                         |                         |
| ----- | ----------------------- | ----------------------- | ----------------------- | ----------------------- |
| 1     | ![[check.png\|40x40]] | ![[uncheck.png\|40x40]] | ![[uncheck.png\|40x40]] | ![[uncheck.png\|40x40]] |
| 2     | ![[uncheck.png\|40x40]] | ![[uncheck.png\|40x40]] | ![[uncheck.png\|40x40]] |                         |

I have yet to figure out how to make the cells less bulky when an image is added but this works really well for now. Plus you can fully customize what your checkmark will look like.

Use case or problem

I am able to draw checkbox in a plain note following these instructions from [ Markdown for Checkbox requires 6 keystrokes. Reduce it to 2?:

To create a checkbox in Obsidian’s markdown, the current implementation requires 6 keystrokes (correct me if I’m wrong, but I believe all 6 are necessary):

  1. Dash
  2. Space
  3. Open bracket
  4. Space
  5. Close bracket
  6. Space
Output Formatting
format-1 output-1

I am creating a table and I would like to check off something once I’m done with it to signify it’s complete like below:

Output

The problem is that:

  1. You cannot use the same process to create a checkbox that has text with it in the same line
  2. You cannot create a checkbox that doesn’t have text before or after it while in a single cell in a table.

Proposed solution

Making it easy to find in the documentation of how to add a checkbox in a table or checkbox that has text before or after it.

Current workaround

I’ve experimented on a couple of solutions from Stack overflow but this response one seems to work best:

Output Formatting
output-3

Pasting this when you want to have an enabled checkbox.

<input type="checkbox" />

Related feature requests

4 Likes

Is it possible to make the workaround persistent? At the moment, if you leave the note all the checkboxes get reset.

This is not working anymore with the new versions, any solution?

The only way I could get the workaround persistent was to manually type checked in the tag. Example below:

Unchecked: <input type="checkbox" />
Checked: <input type="checkbox" checked/>

1 Like

Hopefully the upcoming Tables update will address this.

Use case or problem

I was trying to make a checklist with columns, so I decided to make it a table. But then I found that I can’t put checkboxes inside tables.

Proposed solution

Allow something like this:

| Title             | Extra col |
| ----------------- | --------- |
| [ ] first check   | blah      |
| [ ] 'nother check | more blah |

Current workaround (optional)

I don’t know of a way to get a checkable checkbox in a table anyway, but I could also put an emoji for the time being. It won’t be magically checkable, but at least there’ll be a clear tickmark for done items.

@thany

If you want to deal with the hassle, you can insert an HTML checkbox:

<input type="checkbox">

It’s a hassle, but works.

@cwhiii Unfortunately, ticking such checkbox is not persisted. I would have to keep its ticked state also in the HTML, which kind of does away the convenience of ticking a checkbox. With that in mind, inserting an emoji is actually easier.

1 Like

This was an annoying lack of a feature, so I’ve created the Check, Please! plugin for it.
Just submitted it for review so that it can be added to the official community plugin list: Add plugin Check, Please! by DevAndrewGeorge · Pull Request #2507 · obsidianmd/obsidian-releases · GitHub

5 Likes

Hope this got into the plugin list soon!

1 Like

I’ve found it’s less of a hassle if you use the Templater plugin and then assign it a hotkey.
This has been a awesome workaround!

2 Likes

Looks like it’s waiting on you. Looking forward to its release!