现在好像md的表格样式,和dataview中的表格样式都受到同一个CSS片段的控制。有没有办法规避作用于表格的css片段对dataview的影响。
dataview 的特定 class 是 .dataview,所以 css 设置时可以把 dataview 的表格排除在外:
table:not(.dataview) {
/* ... */
}
/* 以及其他的 table 子元素设置 */
table:not(.dataview) thead {
/* ... */
}
你好,谢谢你的回复。我想知道怎么改,直接粘贴进去不行。下面是我现在用的css
.markdown-source-view div.cm-embed-block.cm-table-widget {
overflow-x: auto;
}
/*
.markdown-source-view div.cm-embed-block.cm-table-widget > div > table {
width: max-content !important;
}
*/
.markdown-reading-view .markdown-preview-view.markdown-rendered table {
width: max-content !important;
}
这一段改成下述代码试试:
.markdown-reading-view .markdown-preview-view.markdown-rendered table:not(.dataview) {
width: max-content !important;
}
可以了,非常感谢
哈哈不客气 祝你晚饭愉快!