Open ioshift opened 10 months ago
使用 扩展 Markdown Parser 并配合自定义 CSS 可以实现表格居中:
.center {
display: flex;
justify-content: center;
align-items: center;
}
onDidParseMarkdown: async function(html) {
const modifiedHtml = html.replace(/<table>/g, '<div class="center"><table>');
return modifiedHtml.replace(/<\/table>/g, '</table></div>');
},
理论上来说不添加 CSS 而是使用 <center>
标签应该同样有效,但考虑到 该标签已被弃用,不建议直接使用该标签。
P.S. 侧边预览中可能无法正常显示,但导出的 HTML 是正确的。
Describe the bug 在表格两段加上
<center>
和</center>
后,Preview中没有产生居中效果Environment
Screenshots