Skip to content

Commit 4cd802f

Browse files
committed
Use border for cells
1 parent abe877a commit 4cd802f

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

src/renderer/render.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import type {
2-
RendererContext,
3-
OutputItem
4-
}
5-
from 'vscode-notebook-renderer';
6-
import {OutputLoader} from './outputLoader';
2+
OutputItem, RendererContext
3+
} from 'vscode-notebook-renderer';
4+
import { OutputLoader } from './outputLoader';
75
const aq = require('arquero');
86
const inputs = require('@observablehq/inputs');
97

@@ -51,7 +49,7 @@ export function render(output: IRenderInfo) {
5149
}
5250
else {
5351
// output text in pre/code tags
54-
output.container.innerHTML = `<pre
52+
output.container.innerHTML = `<pre
5553
style="max-height: 300px; white-space: pre-wrap; tab-size: 2; overflow: auto;">
5654
<code style="display: block; white-space: pre-wrap;">${data}</code>
5755
</pre>`;
@@ -77,7 +75,7 @@ if (module.hot) {
7775

7876
if (typeof data.size === 'number') {
7977
// map or set
80-
return data.size;
78+
return data.size;
8179
}
8280

8381
if (typeof data.numRows === 'function') {
@@ -109,11 +107,20 @@ function addStyles(document: HTMLDocument): HTMLStyleElement {
109107
thead th {
110108
box-shadow: 0 1px 0 var(--vscode-panel-border) !important;
111109
}
112-
110+
111+
th, td {
112+
border: 1px solid var(--vscode-panel-border) !important;
113+
}
114+
115+
th:first-child,
116+
td:first-child {
117+
border-left: none !important;
118+
}
119+
113120
th {
114-
text-align: left !important;
121+
border-top: none !important;
115122
}
116123
`;
117-
124+
118125
return styles;
119126
}

src/renderer/style.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,15 @@ thead th {
1919
th {
2020
text-align: left !important;
2121
}
22+
23+
th, td {
24+
border: 1px solid var(--vscode-panel-border) !important;
25+
}
26+
27+
th:first-child,
28+
td:first-child {
29+
border-left: none !important;
30+
}
31+
th {
32+
border-top: none !important;
33+
}

0 commit comments

Comments
 (0)