Skip to content

Commit

Permalink
chore: width and wrap notes
Browse files Browse the repository at this point in the history
  • Loading branch information
iowillhoit committed Oct 3, 2024
1 parent ab71e39 commit 8c39232
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/multiple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ const projects = [
},
]

// Occasionally, if you have two maxWidths that add up to 100% they will stack vertically instead of horizontally.
// At first I thought this might be when the window has an odd number of pixels, but it seems to be more random than that.

const employeesTable: TableOptions<(typeof employees)[number]> = {
columns: ['id', 'name', 'age', 'description'],
data: employees,
Expand Down
21 changes: 21 additions & 0 deletions examples/orientation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ printTable({
titleOptions: {bold: true},
})

// When the vertical orientation table wraps, the "value" does not stay in its column
// Example (note the "description" column):
//
// ──────────────────────────────────────────────────────────────────────────────────────
// Item Item 1
// Description
// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor
// incididunt ut labore et dolore magna aliqua.
// Url https://www.example.com/item/1
//
// I would expect it to look like this:
//
// Example (note the "description" column):
// ------------------------------------------------
// Item Item 1
// Description Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
// eiusmod tempor incididunt ut labore et dolore magna aliqua.
// Url https://www.example.com/item/1



printTable({
columns: ['item', 'description', 'url'],
data,
Expand Down

0 comments on commit 8c39232

Please sign in to comment.