Reputation: 9931
I am able to draw checkbox in Github README.md lists using
- [ ] (for unchecked checkbox)
- [x] (for checked checkbox)
But this is not working in table. Does anybody know how to implement checkbox or checkmark in GitHub Markdown table?
Upvotes: 965
Views: 1048224
Reputation: 1
Markdown accepts html tags so you can html tags like input checkboxes or radio button so you can use this solution for example:
<input type="checkbox id="task-1">
<label for="task-1">Do something ....</label>
And if you do your task you can add checked attribute to checkbox input for example:
<input type="checkbox id="task-1" checked>
<label for="task-1">Do something ....</label>
Upvotes: 0
Reputation: 5287
Please make sure that you remove the whitespaces around the x
, since GitHub adds them by default:
- [x]
Upvotes: 3
Reputation: 29
by adding cross x in col without spaces you can check desired checkbox
Upvotes: -1
Reputation: 13874
Try adding a -
before the [ ]
or [x]
. That's an -
followed by a blank space
. An unchecked box also need a space
between the brackets.
Below is an example from Github blog.
### Solar System Exploration, 1950s – 1960s
- [ ] Mercury
- [x] Venus
- [x] Earth (Orbit/Moon)
- [x] Mars
- [ ] Jupiter
- [ ] Saturn
- [ ] Uranus
- [ ] Neptune
- [ ] Comet Haley
It appears like below:
Here's how one could do the same in a table:
| Task | Time required | Assigned to | Current Status | Finished |
|----------------|---------------|---------------|----------------|-----------|
| Calendar Cache | > 5 hours | | in progress | - [x] ok?
| Object Cache | > 5 hours | | in progress | [x] item1<br/>[ ] item2
| Object Cache | > 5 hours | | in progress | <ul><li>- [x] item1</li><li>- [ ] item2</li></ul>
| Object Cache | > 5 hours | | in progress | <ul><li>[x] item1</li><li>[ ] item2</li></ul>
- [x] works
- [x] works too
Here's how it looks:
Upvotes: 1273
Reputation: 431
The following works well on GitHub
| Selection | |
| --------- | ------ |
| <li>- [ ] </li> | |
| Selection | |
| --------- | ------ |
| <li>- [x] </li> | |
Upvotes: 1
Reputation: 9018
|checked|unchecked|crossed|
|---|---|---|
|✓|_|✗|
|☑|☐|☒|
checked | unchecked | crossed |
---|---|---|
✓ | _ | ✗ |
☑ | ☐ | ☒ |
Where
Upvotes: 142
Reputation: 585
Unfortunately, the accepted answer doesn't work for me (I'm using GitHub flavoured markdown).
It occurs to me since we're adding HTML elements, why not just add an <input>
instead.
| demo | demo |
| ------------------------------------------------- | ---- |
| <input type="checkbox" disabled checked /> works | |
| <input type="checkbox" disabled /> works here too | |
This should work in any environment cuz it's plain HTML (see FYI below).
FYI, this example was tested in VS Code markdown preview mode(GitHub flavoured), the screenshot is also taken in VS Code preview mode. It's not working on GitHub.
Emoji mentioned above is a good alternative, if this doesn't work in your target environment.
Upvotes: 37
Reputation: 9344
If you have an issue with the standard markdown code. You can use emojis.
If you are using GitHub's default emojis, you can use these. Something to note is that there is no uncheck, so you have to use different emojis to get that look.
⬜
:white_large_square
✅
:white_check_mark
:white_large_square
: https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md#geometric
:white_check_mark
: https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md#other-symbol
Complete list https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md
Upvotes: 21
Reputation: 1622
There are very nice Emoji
icons instructions available at
You can check them out. I hope you would find suitable icons for your writing.
Best,
Upvotes: 82
Reputation: 85578
Now emojis are supported! :white_check_mark:
/ :heavy_check_mark:
gives a good impression and is widely supported:
Function | MySQL / MariaDB | PostgreSQL | SQLite
:------------ | :-------------| :-------------| :-------------
substr | :heavy_check_mark: | :white_check_mark: | :heavy_check_mark:
renders to (here on older chromium 65.0.3x) :
Upvotes: 197
Reputation: 2815
You can use emojis
Done? | Name
:---:| ---
⬜️| Nope
✅| Yep
Upvotes: 74
Reputation: 6806
I used ☐
(☐) for [ ]
and ☑
(☑) for [x]
and it works for marked.js which says it is compatible with Github markdown. I based my solution on answers for this question. See also this informative answer.
Update: I should have mentioned that when you do it this way, you do not need the <ul>
, e.g:
| Unchecked | Checked |
| --------- | ------- |
| ☐ | ☑ |
Upvotes: 120
Reputation: 726
Edit the document or wiki page, and use the - [ ]
and - [x]
syntax to update your task list. Furthermore you can refer to this link.
Upvotes: 18
Reputation: 69
Here is what I have that helps you and others about markdown checkbox table. Enjoy!
| Projects | Operating Systems | Programming Languages | CAM/CAD Programs | Microcontrollers and Processors |
|---------------------------------- |---------------|---------------|----------------|-----------|
| <ul><li>[ ] Blog </li></ul> | <ul><li>[ ] CentOS</li></ul> | <ul><li>[ ] Python </li></ul> | <ul><li>[ ] AutoCAD Electrical </li></ul> | <ul><li>[ ] Arduino </li></ul> |
| <ul><li>[ ] PyGame</li></ul> | <ul><li>[ ] Fedora </li></ul> | <ul><li>[ ] C</li></ul> | <ul><li>[ ] 3DsMax </li></ul> |<ul><li>[ ] Raspberry Pi </li></ul> |
| <ul><li>[ ] Server Info Display</li></ul>| <ul><li>[ ] Ubuntu</li></ul> | <ul><li>[ ] C++ </li></ul> | <ul><li>[ ] Adobe AfterEffects </li></ul> |<ul><li>[ ] </li></ul> |
| <ul><li>[ ] Twitter Subs Bot </li></ul> | <ul><li>[ ] ROS </li></ul> | <ul><li>[ ] C# </li></ul> | <ul><li>[ ] Adobe Illustrator </li></ul> |<ul><li>[ ] </li></ul> |
Upvotes: 4
Reputation: 1071
Following is how I draw a checkbox in a table!
| Checkbox Experiments | [ ] unchecked header | [x] checked header |
| ---------------------|:---------------------:|:-------------------:|
| checkbox | [ ] row | [x] row |
Upvotes: 2