Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rendering HTML tables from Markdown #403

Unanswered
Clarity-89 asked this question in Q&A
Discussion options

Couldn't find any info on this, but is it possible to generate tables defined inside MDX as Markdown tables? For ex., I have this table in my post and it isn't rendered as the HTML table in the output:

| Name | Type | Description |
| ---- | ---- | ----------- |
| `name` | string | Name of the resource |
| `path` | string | Path to the resource |
You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

Markdown doesn't support table syntax, but you can use remark-gfm to support it.

To be able to use remark/rehype plugins in Contentlayer, you can read it here.

You must be logged in to vote
2 replies
Comment options

In the end I created a separate Table React component, which I then use inside the mdx.

Comment options

hi @Clarity-89 can you please share more about your approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #402 on March 27, 2023 06:47.

AltStyle によって変換されたページ (->オリジナル) /