Skip to content

Commit

Permalink
fix: margins on plain text table
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 30, 2024
1 parent 216c0ff commit b541bd1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,11 @@ function renderPlainTable<T extends Record<string, unknown>>(props: TableOptions
horizontalAlignment,
overflow,
padding,
value: column.column,
value: headings[column.column] ?? column.column,
width,
})
const columnHeader = headings[text] ?? text
return `${acc}${' '.repeat(marginLeft)}${columnHeader}${' '.repeat(marginRight)}`

return `${acc}${' '.repeat(marginLeft)}${text}${' '.repeat(marginRight)}`
}, '')
console.log(headerString)
console.log('-'.repeat(headerString.length))
Expand Down Expand Up @@ -588,7 +588,7 @@ export function printTables<T extends Record<string, unknown>[]>(
tables: {[P in keyof T]: TableOptions<T[P]>},
options?: Omit<ContainerProps, 'children'>,
): void {
if (tables.reduce((acc, table) => acc + table.data.length, 0) > 30_000) {
if (tables.reduce((acc, table) => acc + table.data.length, 0) > 10_000) {
throw new Error('The data is too large to print multiple tables. Please use `printTable` instead.')
}

Expand Down

0 comments on commit b541bd1

Please sign in to comment.