diff --git a/SharpbinV3.Client/src/routes/[id]/+page.svelte b/SharpbinV3.Client/src/routes/[id]/+page.svelte
index 806d62c..0005f79 100644
--- a/SharpbinV3.Client/src/routes/[id]/+page.svelte
+++ b/SharpbinV3.Client/src/routes/[id]/+page.svelte
@@ -182,13 +182,25 @@
}
const rows = results.data as string[][];
+ const [header, ...body] = rows;
+
+ const escape = (v: string) =>
+ v.replace(/&/g, '&').replace(//g, '>');
+
const tableHtml = `
-
-
- ${rows.map((row) => `${row.map((cell) => `| ${cell ? cell.replace(/&/g, '&').replace(//g, '>') : ''} | `).join('')}
`).join('')}
-
-
- `;
+
+
+
+ ${header.map((c) => `| ${c ? escape(c) : ''} | `).join('')}
+
+
+
+ ${body
+ .map((row) => `${row.map((c) => `| ${c ? escape(c) : ''} | `).join('')}
`)
+ .join('')}
+
+
+ `;
pasteContent = tableHtml;
contentRendered = true;
@@ -959,29 +971,41 @@
}
.csv-table {
- border-collapse: collapse;
+ border-collapse: separate;
+ border-spacing: 0;
background-color: var(--color-neutral-800);
border-bottom-left-radius: 0.25rem;
border-bottom-right-radius: 0.25rem;
min-width: 100%;
}
- .csv-table tr {
+ .csv-table thead th {
+ position: sticky;
+ top: 0;
+ background-color: var(--color-neutral-800);
+ border-bottom: 2px solid var(--color-neutral-700);
+ z-index: 2;
+ }
+
+ .csv-table tbody tr,
+ .csv-table thead th {
border-bottom: 1px solid var(--color-neutral-700);
}
- .csv-table tr:hover {
+ .csv-table tbody tr:hover,
+ .csv-table thead tr:hover {
background-color: rgba(255, 255, 255, 0.05);
}
- .csv-table td {
+ .csv-table tbody td,
+ .csv-table thead th {
padding: 0.75rem 1rem;
text-align: left;
color: var(--color-neutral-300);
white-space: nowrap;
}
- .csv-table tr:last-child {
+ .csv-table tbody tr:last-child {
border-bottom: none;
}