我可以使用在 Github README.md 列表中绘制复选框
- [ ] (for unchecked checkbox)
- [x] (for checked checkbox)
但这在表格中不起作用。有人知道如何在 GitHub Markdown 表中实现复选框或复选标记吗?
- [ ] myLabel
尝试在 []
或 [x]
之前添加 -
。这是一个 -
,后跟一个空格 。
下面是一个来自 Github 博客的例子。
### Solar System Exploration, 1950s – 1960s
- [ ] Mercury
- [x] Venus
- [x] Earth (Orbit/Moon)
- [x] Mars
- [ ] Jupiter
- [ ] Saturn
- [ ] Uranus
- [ ] Neptune
- [ ] Comet Haley
如下所示:
https://i.stack.imgur.com/GOySK.png
以下是如何在表格中执行相同操作:
| 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
这是它的外观:
https://i.stack.imgur.com/aWZ2t.png
现在支持表情符号! :white_check_mark:
/ :heavy_check_mark:
给人留下好印象并得到广泛支持:
Function | MySQL / MariaDB | PostgreSQL | SQLite
:------------ | :-------------| :-------------| :-------------
substr | :heavy_check_mark: | :white_check_mark: | :heavy_check_mark:
渲染到(这里在旧铬 65.0.3x 上):
https://i.stack.imgur.com/m1CY1.png
:white_check_mark:
现在看起来像一个带有白色复选标记的绿色复选框。
我对 [ ]
使用了 ☐
(☐),对 [x]
使用了 ☑
(☑),它适用于 marked.js,它表示它与 Github markdown 兼容。我的解决方案基于 answers for this question。另见this informative answer。
更新:我应该提到,当你这样做时,你不需要 <ul>
,例如:
| Unchecked | Checked |
| --------- | ------- |
| ☐ | ☑ |
您可以使用表情符号
Done? | Name
:---:| ---
⬜️| Nope
✅| Yep
:white_large_square
和复选框使用 :white_check_mark
|checked|unchecked|crossed|
|---|---|---|
|✓|_|✗|
选中 未选中 划线 ✓ _ ✗
在哪里
✓ 通过 HTML Entity Code
✗ 通过 HTML Entity Code
_ 通过下划线字符
和通过 markdown table syntax 的表格。
有非常好的 Emoji
图标说明可在
https://gist.github.com/rxaviers/7360908
或在 https://github.com/StylishThemes/GitHub-Dark/wiki/Emoji
您可以查看它们。我希望你能找到适合你写作的图标。
https://i.stack.imgur.com/PernX.png
最好的,
不幸的是,接受的答案对我不起作用(我使用的是 GitHub 风格的降价)。
既然我们正在添加 HTML 元素,我就想到了,为什么不直接添加一个 <input>
。
| demo | demo |
| ------------------------------------------------- | ---- |
| <input type="checkbox" disabled checked /> works | |
| <input type="checkbox" disabled /> works here too | |
这应该适用于任何环境,因为它是纯 HTML(请参阅下面的仅供参考)。
https://i.stack.imgur.com/3Fc0Z.png
仅供参考,这个例子是在 VS Code markdown 预览模式下测试的(GitHub 风格),截图也是在 VS Code 预览模式下拍摄的。它不适用于 GitHub。
上面提到的表情符号是一个不错的选择,如果这在您的目标环境中不起作用。
09 2021
如果您对标准降价代码有疑问。您可以使用表情符号。
本地 Github
如果你使用 GitHub 的默认表情符号,你可以使用这些。需要注意的是,没有取消选中,因此您必须使用不同的表情符号才能获得该外观。
⬜ :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
完整列表 https://github.com/ikatyang/emoji-cheat-sheet/blob/master/README.md
编辑文档或 wiki 页面,并使用 - [ ]
和 - [x]
语法更新您的任务列表。此外,您可以参考this link。
这是我所拥有的可以帮助您和其他人了解降价复选框表的内容。享受!
| 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> |
以下是我如何在表格中绘制复选框!
| Checkbox Experiments | [ ] unchecked header | [x] checked header |
| ---------------------|:---------------------:|:-------------------:|
| checkbox | [ ] row | [x] row |
https://i.stack.imgur.com/UsnDw.png
Github flavoured markdown
呈现。但适用于其他降价预览器。
不定期副业成功案例分享