Skip to content

Build your personal knowledge base with Trilium Notes

feat(markdown): improve style for plain tables

Elian Doranf6c52131a27e
diff --git a/apps/client/src/widgets/type_widgets/code/Markdown.tsx b/apps/client/src/widgets/type_widgets/code/Markdown.tsx
index 9ea9c62bf8..e7f3ad7479 100644
--- a/apps/client/src/widgets/type_widgets/code/Markdown.tsx
+++ b/apps/client/src/widgets/type_widgets/code/Markdown.tsx
@@ -1,4 +1,5 @@
import "./Markdown.css";
+import "./MarkdownCommons.css";
import { autocompletion } from "@codemirror/autocomplete";
import { syntaxTree } from "@codemirror/language";
diff --git a/apps/client/src/widgets/type_widgets/code/MarkdownCommons.css b/apps/client/src/widgets/type_widgets/code/MarkdownCommons.css
new file mode 100644
index 0000000000..af1d53e23e
--- /dev/null
+++ b/apps/client/src/widgets/type_widgets/code/MarkdownCommons.css
@@ -0,0 +1,21 @@
+.note-detail-markdown .markdown-preview,
+.note-detail-readonly-text-content.llm-chat-markdown {
+
+ table {
+ border-collapse: collapse;
+ width: 100%;
+ margin: 0.75em 0;
+
+ th,
+ td {
+ border: 1px solid var(--main-border-color);
+ padding: 0.5em 0.75em;
+ text-align: left;
+ }
+
+ th {
+ background: var(--accented-background-color);
+ font-weight: 600;
+ }
+ }
+}
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.css b/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.css
index 36c64f6b30..2f41c69c8d 100644
--- a/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.css
+++ b/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.css
@@ -225,24 +225,6 @@
margin: 1em 0;
}
-.llm-chat-markdown table {
- border-collapse: collapse;
- width: 100%;
- margin: 0.75em 0;
-}
-
-.llm-chat-markdown th,
-.llm-chat-markdown td {
- border: 1px solid var(--main-border-color);
- padding: 0.5em 0.75em;
- text-align: left;
-}
-
-.llm-chat-markdown th {
- background: var(--accented-background-color);
- font-weight: 600;
-}
-
.llm-chat-markdown strong {
font-weight: 600;
}
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx b/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx
index 43c06a4ac7..b018eb9be9 100644
--- a/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx
+++ b/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx
@@ -1,4 +1,5 @@
import "./ChatMessage.css";
+import "../code/MarkdownCommons.css";
import { type LlmCitation, renderToHtml } from "@triliumnext/commons";
import DOMPurify from "dompurify";