Can not render a <pre> element inside a <table> #1910
-
Hi I'm trying to render a Example code: <table>
<tbody>
<tr>
<td>
<pre>.button {
color: blue;
}</pre>
</td>
</tr>
</tbody>
</table> Is there a way to render a code block inside a table? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
This seems to work, but it strips the whitespace, which should be preserved in
|
Beta Was this translation helpful? Give feedback.
-
It looks like you are trying to render a codeblock? <table>
<tbody>
<tr>
<td>
```css
.button {
color: blue;
}
```
</td>
</tr>
</tbody>
</table> mdx 1 (currently used by storybook) allows markdown to be embedded in JSX if there are spacing newlines between the JSX and the Markdown. |
Beta Was this translation helpful? Give feedback.
-
Thanks that's helpful. I had to remove all indentation in the whole table like you did. Unfortunate requirement but it works. |
Beta Was this translation helpful? Give feedback.
It looks like you are trying to render a codeblock?
Another option would be try something like:
mdx 1 (currently used by storybook) allows markdown to be embedded in JSX if there are spacing newlines between the JSX and the Markdown.