Add support for table caption in grid table #118

Closed
opened 2026-01-29 14:27:38 +00:00 by claunia · 6 comments
Owner

Originally created by @pearsonn on GitHub (Jun 14, 2017).

It would be great if there was a syntactic way of specifying a table caption to output a <caption> element within the table.

Originally created by @pearsonn on GitHub (Jun 14, 2017). It would be great if there was a syntactic way of specifying a table caption to output a `<caption>` element within the table.
claunia added the enhancementwontfix labels 2026-01-29 14:27:38 +00:00
Author
Owner

@xoofx commented on GitHub (Jun 28, 2017):

Problem is that it is quite difficult to make Markdown syntax simple if we want to cover every features available in HTML... so not sure there is a plain syntax way to do this easily...

@xoofx commented on GitHub (Jun 28, 2017): Problem is that it is quite difficult to make Markdown syntax simple if we want to cover every features available in HTML... so not sure there is a plain syntax way to do this easily...
Author
Owner

@christophano commented on GitHub (Jul 11, 2017):

Would this not be a good use case for the existing <figure>/<figcaption> functionality?

I was about to suggest a change to remove the figure and move the <figcaption> contents to a <caption> for cases where the only child of a <figure> is a table but the MDN Documentation has its own recommendation.

When the <table> element that is the parent of this <caption> is the only descendant of a <figure> element, use the <figcaption> element instead.

@christophano commented on GitHub (Jul 11, 2017): Would this not be a good use case for the existing `<figure>`/`<figcaption>` functionality? I was about to suggest a change to remove the figure and move the `<figcaption>` contents to a `<caption>` for cases where the only child of a `<figure>` is a table but the [MDN Documentation](https://developer.mozilla.org/en/docs/Web/HTML/Element/caption) has its own recommendation. > When the `<table>` element that is the parent of this `<caption>` is the only descendant of a `<figure>` element, use the `<figcaption>` element instead.
Author
Owner

@PulsarFX commented on GitHub (Sep 28, 2017):

What about

| First Header | Second Header | Third Header |  
| ------------ | :-----------: | -----------: |  
| Content      | **Cell**      | Cell         |  
| New section  | More          | Data         |  
[table caption]

taken from
http://fletcherpenney.net/multimarkdown/
https://rawgit.com/fletcher/human-markdown-reference/master/index.html

@PulsarFX commented on GitHub (Sep 28, 2017): What about ``` | First Header | Second Header | Third Header | | ------------ | :-----------: | -----------: | | Content | **Cell** | Cell | | New section | More | Data | [table caption] ``` taken from http://fletcherpenney.net/multimarkdown/ https://rawgit.com/fletcher/human-markdown-reference/master/index.html
Author
Owner

@NeomMob commented on GitHub (Oct 4, 2019):

I would be really happy to have it like MMD.

@NeomMob commented on GitHub (Oct 4, 2019): I would be really happy to have it like MMD.
Author
Owner

@SebastianRaffel commented on GitHub (Jul 10, 2020):

A workaround could be to use attribute extensions and generate <caption> from that afterwards. Works with markdig(advanced): babelmark

{caption="my Caption"}
| col1  | col2 |
| ----- | ---- |
| cell1 | cell2|
@SebastianRaffel commented on GitHub (Jul 10, 2020): A workaround could be to use [attribute extensions](https://github.com/lunet-io/markdig/issues/226#issuecomment-391947172) and generate `<caption>` from that afterwards. Works with markdig(advanced): [babelmark](https://babelmark.github.io/?text=%7Bcaption%3D%22my+Caption%22%7D%0A%7C+col1++%7C+col2+%7C%0A%7C+-----+%7C+----+%7C%0A%7C+cell1+%7C+cell2%7C%0A) ```markdown {caption="my Caption"} | col1 | col2 | | ----- | ---- | | cell1 | cell2| ```
Author
Owner

@xoofx commented on GitHub (Jul 10, 2020):

Agreed, that can be workaround or done with a custom extension, but I don't see how we can come up with something that would work beyond Markdig.

Closing as wontfix

@xoofx commented on GitHub (Jul 10, 2020): Agreed, that can be workaround or done with a custom extension, but I don't see how we can come up with something that would work beyond Markdig. Closing as wontfix
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#118