ascii icon indicating copy to clipboard operation
ascii copied to clipboard

github tables?

Open yihui opened this issue 13 years ago • 5 comments

The (hidden) github table syntax is very similar to org:

|   | agegp | alcgp     | tobgp    |
|---+-------+-----------+----------|
| 1 | 25-34 | 0-39g/day | 0-9g/day |
| 2 | 25-34 | 0-39g/day | 10-19    |
| 3 | 25-34 | 0-39g/day | 20-29    |
| 4 | 25-34 | 0-39g/day | 30+      |
| 5 | 25-34 | 40-79     | 0-9g/day |

instead of using +, github uses |.

agegp alcgp tobgp
1 25-34 0-39g/day 0-9g/day
2 25-34 0-39g/day 10-19
3 25-34 0-39g/day 20-29
4 25-34 0-39g/day 30+
5 25-34 40-79 0-9g/day

is there a simple way to generate a GitHub table? It looks like a very tiny tweak.

Thanks for this great package!

yihui avatar Mar 31 '12 23:03 yihui

Hi,

Thanks for your interest!

There is no simple way now, but it is very easy to add this. Can you tell me:

  • if github tables can have a caption?
  • if cells can have a specific style (bold, italic, monospaced...)?
  • if col/row spanning is supported?

eusebe avatar Apr 02 '12 14:04 eusebe

I'm not sure, so I have contacted GitHub staff. I'll let you know after I've got the response. Thanks!

yihui avatar Apr 03 '12 01:04 yihui

AFAIK there is no support for caption, cell styling or col/row spanning. But then, I would be happy to be wrong :)

ramnathv avatar Apr 03 '12 01:04 ramnathv

Hey! GFM has been using a Tables extension for quite a while now. The syntax is the same as Tables on PHP Markdown Extra. Let me fix up the official documentation...

vmg avatar Apr 04 '12 15:04 vmg

thanks for clarification, @tanoku

yihui avatar Apr 04 '12 16:04 yihui