Skip to content

Commit d96fe55

Browse files
authored
Merge pull request #98 from basecamp/fix-list-column-spacing
Add column spacing to styled list output
2 parents 93a5a50 + b1dd126 commit d96fe55

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

internal/render/render.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ type Column struct {
2222
type Columns []Column
2323

2424
// headerStyle is the style for table headers in styled output.
25-
var headerStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("12"))
25+
var headerStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("12")).PaddingRight(1)
26+
27+
// cellStyle is the style for table data cells in styled output.
28+
var cellStyle = lipgloss.NewStyle().PaddingRight(1)
2629

2730
// StyledList renders a slice of maps as a styled terminal table.
2831
func StyledList(data []map[string]any, cols Columns, summary string) string {
@@ -61,7 +64,7 @@ func StyledList(data []map[string]any, cols Columns, summary string) string {
6164
if row == table.HeaderRow {
6265
return headerStyle
6366
}
64-
return lipgloss.NewStyle()
67+
return cellStyle
6568
})
6669

6770
var sb strings.Builder

0 commit comments

Comments
 (0)