@@ -219,10 +219,11 @@ class CsvEditorProvider implements vscode.CustomTextEditorProvider {
219219 result = { data : [ ] } ;
220220 }
221221 const fontFamily = config . get < string > ( 'fontFamily' , 'Menlo' ) ;
222+ const cellPadding = config . get < number > ( 'cellPadding' , 4 ) ;
222223 const data = result . data as string [ ] [ ] ;
223224 const htmlContent = this . generateHtmlContent ( data , treatHeader , addSerialIndex , fontFamily ) ;
224225 const nonce = getNonce ( ) ;
225- this . currentWebviewPanel ! . webview . html = this . wrapHtml ( htmlContent , nonce , fontFamily ) ;
226+ this . currentWebviewPanel ! . webview . html = this . wrapHtml ( htmlContent , nonce , fontFamily , cellPadding ) ;
226227 }
227228
228229 /**
@@ -296,7 +297,7 @@ class CsvEditorProvider implements vscode.CustomTextEditorProvider {
296297 /**
297298 * Wraps the provided HTML content in a complete HTML document with a strict Content Security Policy.
298299 */
299- private wrapHtml ( content : string , nonce : string , fontFamily : string ) : string {
300+ private wrapHtml ( content : string , nonce : string , fontFamily : string , cellPadding : number ) : string {
300301 const isDark = vscode . window . activeColorTheme . kind === vscode . ColorThemeKind . Dark ;
301302 return `<!DOCTYPE html>
302303<html>
@@ -309,7 +310,7 @@ class CsvEditorProvider implements vscode.CustomTextEditorProvider {
309310 body { font-family: "${ fontFamily } "; margin: 0; padding: 0; user-select: none; }
310311 .table-container { overflow-x: auto; max-height: 100vh; }
311312 table { border-collapse: collapse; width: max-content; }
312- th, td { padding: 4px 8px; border: 1px solid #555; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
313+ th, td { padding: ${ cellPadding } px 8px; border: 1px solid #555; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
313314 th { position: sticky; top: 0; background-color: ${ isDark ? '#1e1e1e' : '#ffffff' } ; }
314315 td.selected, th.selected { background-color: ${ isDark ? '#333333' : '#cce0ff' } !important; }
315316 td.editing, th.editing { overflow: visible !important; white-space: normal !important; max-width: none !important; }
0 commit comments