refactor: NewTable for consistent CLI table rendering, style images for ls,ps

This commit is contained in:
Pasha Sviderski
2026-03-30 14:08:50 +10:00
parent 9aee75ba28
commit e22cdf0b18
6 changed files with 35 additions and 41 deletions
+2
View File
@@ -6,6 +6,8 @@ import (
)
var (
NoStyle = lipgloss.NewStyle()
Faint = lipgloss.NewStyle().Faint(true)
Red = lipgloss.NewStyle().Foreground(lipgloss.Red)
Green = lipgloss.NewStyle().Foreground(lipgloss.Green)
+24
View File
@@ -0,0 +1,24 @@
package tui
import (
"charm.land/lipgloss/v2"
"charm.land/lipgloss/v2/table"
)
// NewTable creates a borderless table with bold headers and consistent padding for CLI output.
func NewTable() *table.Table {
return table.New().
Border(lipgloss.Border{}).
BorderTop(false).
BorderBottom(false).
BorderLeft(false).
BorderRight(false).
BorderHeader(false).
BorderColumn(false).
StyleFunc(func(row, col int) lipgloss.Style {
if row == table.HeaderRow {
return Bold.PaddingRight(3)
}
return NoStyle.PaddingRight(3)
})
}