1
0
Fork 0

Small fix for `addTable` method

There was an issue with the `tableData` object. Each row needs to be an array.
pull/1767/head
Elio Struyf 2024-07-03 16:13:45 +02:00 committed by GitHub
parent 361a115e53
commit 364af2caa9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 9 deletions

View File

@ -451,16 +451,19 @@ For example
```typescript ```typescript
const tableData = [ const tableData = [
[
{data: 'Header1', header: true}, {data: 'Header1', header: true},
{data: 'Header2', header: true}, {data: 'Header2', header: true},
{data: 'Header3', header: true}, {data: 'Header3', header: true},
], [
{data: 'MyData1'}, {data: 'MyData1'},
{data: 'MyData2'}, {data: 'MyData2'},
{data: 'MyData3'} {data: 'MyData3'}
] ]
];
// Add an HTML table // Add an HTML table
core.summary.addTable([tableData]) core.summary.addTable(tableData)
// Output: <table><tr><th>Header1</th><th>Header2</th><th>Header3</th></tr><tr></tr><td>MyData1</td><td>MyData2</td><td>MyData3</td></tr></table> // Output: <table><tr><th>Header1</th><th>Header2</th><th>Header3</th></tr><tr></tr><td>MyData1</td><td>MyData2</td><td>MyData3</td></tr></table>
``` ```