How to wrap a div element on a table. #3571
Answered
by
UziTech
YanceyOfficial
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
UziTech
Dec 29, 2024
Replies: 1 comment 1 reply
-
You can use the original renderer to render the table. import { Marked, Renderer } from 'marked';
const renderer = new Renderer();
const marked = new Marked({
renderer: {
table(...arguments) {
return `<div>${renderer.table.apply(this, arguments)}</div>`;
},
},
});
console.log(marked.parse(`
| a | b |
| - | - |
| c | d |
`)); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
YanceyOfficial
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the original renderer to render the table.