feat: refine table presentation and editable Word export

This commit is contained in:
2026-11-04 15:40:52 +08:00
parent 31d0ccfde5
commit 3bb2cc5438
15 changed files with 337 additions and 58 deletions
+53 -39
View File
@@ -209,57 +209,45 @@ table {
}
.table-wrapper {
margin: 1.2em 0;
position: relative;
margin: max(1.2em, 28px) 0 1.2em;
}
.table-scroll {
overflow-x: auto;
border: 1px solid #d5dbe5;
border-radius: 8px;
border-radius: 6px;
background: #ffffff;
}
.table-wrapper table {
min-width: 640px;
margin: 0;
border: 0;
}
.table-wrapper th:first-child,
.table-wrapper td:first-child {
border-left: 0;
}
.table-wrapper th:last-child,
.table-wrapper td:last-child {
border-right: 0;
}
.table-wrapper tr:first-child th,
.table-wrapper tr:first-child td {
border-top: 0;
}
.table-wrapper tr:last-child th,
.table-wrapper tr:last-child td {
border-bottom: 0;
table-layout: auto;
}
.table-tools {
position: sticky;
left: 0;
position: absolute;
bottom: 100%;
right: 2px;
margin-bottom: 4px;
display: flex;
justify-content: flex-end;
gap: 0.45em;
padding: 0.44em 0.52em;
border-bottom: 1px solid #d5dbe5;
background: #f7f9fc;
opacity: 0;
pointer-events: none;
}
.table-wrapper:hover .table-tools,
.table-wrapper:focus-within .table-tools {
opacity: 1;
pointer-events: auto;
}
.copy-table-button {
padding: 0.25em 0.62em;
padding: 2px 8px;
border: 1px solid #c8d0dc;
border-radius: 5px;
background: #ffffff;
color: #354052;
font: 600 0.78em "Segoe UI", "Microsoft YaHei UI", sans-serif;
font: 600 12px/18px "Segoe UI", "Microsoft YaHei UI", sans-serif;
cursor: pointer;
}
@@ -267,14 +255,21 @@ table {
background: #f0f4f8;
}
:where(html[data-theme="dark"]) .table-wrapper {
border-color: #3a4352;
.copy-table-button:focus-visible {
outline: 2px solid #3578c8;
outline-offset: 2px;
}
@media (hover: none) {
.table-tools { opacity: 1; pointer-events: auto; }
}
:where(html[data-theme="dark"]) .table-scroll {
background: #20242c;
}
:where(html[data-theme="dark"]) .table-tools {
border-bottom-color: #3a4352;
background: #242b36;
:where(html[data-theme="dark"]) .reader {
--reader-table-stripe: #252c37;
}
:where(html[data-theme="dark"]) .copy-table-button {
@@ -290,12 +285,15 @@ table {
th,
td {
border: 1px solid #d5dbe5;
border-left-color: #e8ecf2;
border-right-color: #e8ecf2;
padding: 0.62em 0.76em;
vertical-align: top;
overflow-wrap: anywhere;
}
th {
background: #edf1f6;
background: #f1f5f9;
font-weight: 650;
text-align: left;
}
@@ -303,12 +301,28 @@ th {
:where(html[data-theme="dark"]) th,
:where(html[data-theme="dark"]) td {
border-color: #3a4352;
border-left-color: #303845;
border-right-color: #303845;
}
:where(html[data-theme="dark"]) th {
background: #2b3340;
}
:where(th, td) code {
white-space: normal;
overflow-wrap: anywhere;
}
thead { display: table-header-group; }
tr { break-inside: avoid; }
@media print {
.table-tools { display: none; }
.table-wrapper { margin: 1.2em 0; }
.table-scroll { overflow: visible; border-radius: 0; }
}
code {
font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
}