From eef2bf2815b63a739601f26b60c6ac6246793136 Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Fri, 24 Jan 2025 20:53:09 +0300
Subject: [PATCH] Update htmlTable.ts
---
scripts/core/htmlTable.ts | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/scripts/core/htmlTable.ts b/scripts/core/htmlTable.ts
index 72d6bd8d..144ba01b 100644
--- a/scripts/core/htmlTable.ts
+++ b/scripts/core/htmlTable.ts
@@ -2,9 +2,15 @@ type Column = {
name: string
nowrap?: boolean
align?: string
+ colspan?: number
}
-type DataItem = string[]
+type DataItem = {
+ value: string
+ nowrap?: boolean
+ align?: string
+ colspan?: number
+}[]
export class HTMLTable {
data: DataItem[]
@@ -20,20 +26,23 @@ export class HTMLTable {
output += ' \r\n '
for (const column of this.columns) {
- output += ` \r\n \r\n'
output += ' ${column.name} `
+ const nowrap = column.nowrap ? ' nowrap' : ''
+ const align = column.align ? ` align="${column.align}"` : ''
+ const colspan = column.colspan ? ` colspan="${column.colspan}"` : ''
+
+ output += `${column.name} `
}
output += '