A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
feat(ui): add border and responsive on table
robin2c23b8396b46
diff --git a/ui/src/components/Editor/utils/index.ts b/ui/src/components/Editor/utils/index.tsindex 8c767559..10ec9664 100644--- a/ui/src/components/Editor/utils/index.ts+++ b/ui/src/components/Editor/utils/index.ts@@ -113,4 +113,20 @@ export function htmlRender(el: HTMLElement | null) {});},);++ el.querySelectorAll('table').forEach((table) => {+ if (+ (table.parentNode as HTMLDivElement)?.classList.contains(+ 'table-responsive',+ )+ ) {+ return;+ }++ table.classList.add('table', 'table-bordered');+ const div = document.createElement('div');+ div.className = 'table-responsive';+ table.parentNode?.replaceChild(div, table);+ div.appendChild(table);+ });}diff --git a/ui/src/index.scss b/ui/src/index.scssindex 780a71e2..207437bd 100644--- a/ui/src/index.scss+++ b/ui/src/index.scss@@ -242,6 +242,12 @@ a {margin-bottom: 0;}}+ table {+ td,+ th {+ word-break: initial;+ }+ }}.upload-img-wrap {@@ -288,8 +294,13 @@ a {}@keyframes bg-fade-out {- 0%, 25% {background-color: var(--bs-highlight-bg)}- 100% { background-color: transparent }+ 0%,+ 25% {+ background-color: var(--bs-highlight-bg);+ }+ 100% {+ background-color: transparent;+ }}.bg-fade-out {animation: bg-fade-out 2s ease 0.3s;