File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed
Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import type {
44}
55from 'vscode-notebook-renderer' ;
66import errorOverlay from 'vscode-notebook-error-overlay' ;
7- import { render } from './render' ;
7+ import { render } from './render' ;
88
99// eslint-disable-next-line @typescript-eslint/naming-convention
1010declare const __webpack_relative_entrypoint_to_root__ : string ;
@@ -19,6 +19,7 @@ export const activate: ActivationFunction = context => {
1919 renderOutputItem ( outputItem : OutputItem , element : HTMLElement ) {
2020 errorOverlay . wrap ( element , ( ) => {
2121 const cellOutputContainer : HTMLDivElement = document . createElement ( 'div' ) ;
22+ cellOutputContainer . className = 'data-table' ;
2223 element . appendChild ( cellOutputContainer ) ;
2324 render ( {
2425 container : cellOutputContainer ,
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ export function render(output: IRenderInfo) {
3434 break ;
3535 }
3636
37+ // add data table view styles
38+ addStyles ( document ) ;
39+
3740 if ( Array . isArray ( data ) ) {
3841 // create data table view
3942 const table = inputs . table ( data , {
@@ -84,3 +87,24 @@ if (module.hot) {
8487
8588 return 0 ;
8689}
90+
91+ function addStyles ( document : HTMLDocument ) : HTMLStyleElement {
92+ const styles : HTMLStyleElement = document . createElement ( 'style' ) ;
93+ document . head . appendChild ( styles ) ;
94+ styles . textContent = `
95+ .data-table {
96+ max-width: 100%;
97+ background-color: var(--vscode-editor-background);
98+ border: 1px solid var(--vscode-panel-border);
99+ }
100+
101+ .data-table form {
102+ margin: 0px !important;
103+ }
104+
105+ .data-table form table thead th {
106+ background-color: var(--vscode-editor-background) !important;
107+ }
108+ ` ;
109+ return styles ;
110+ }
Original file line number Diff line number Diff line change 11.data-table {
22 max-width : 100% ;
3- overflow-y : scroll;
3+ background-color : var (--vscode-editor-background );
4+ border : 1px solid var (--vscode-panel-border );
5+ }
6+
7+ .data-table form {
8+ margin : 0px !important ;
9+ }
10+
11+ .data-table form table thead th {
12+ background-color : var (--vscode-editor-background ) !important ;
413}
You can’t perform that action at this time.
0 commit comments