From d670c6256268b2d8e9b9f313bfe02bfc5fe08321 Mon Sep 17 00:00:00 2001 From: nutcas3 Date: Fri, 17 Apr 2026 16:13:35 +0300 Subject: [PATCH] feat: Update table border rendering to use different characters based on position - Add borderChar variable to determine border style based on position parameter - Use "=" for top and bottom borders, "-" for middle borders - Replace hardcoded "=" with dynamic borderChar in sections rendering - Remove redundant comment about convenience methods --- apps/cli/internal/ui/table.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/cli/internal/ui/table.go b/apps/cli/internal/ui/table.go index 2a80473..77a7688 100644 --- a/apps/cli/internal/ui/table.go +++ b/apps/cli/internal/ui/table.go @@ -225,13 +225,24 @@ func (t *Table) renderBorderLine(position string) string { } var sections []string + var borderChar string + + // Use position parameter to determine border style + switch position { + case "top", "bottom": + borderChar = "=" + case "middle": + borderChar = "-" + default: + borderChar = "=" + } for _, col := range t.Columns { width := col.Width + 2 // Account for padding if t.Style.Padding > 0 { width += t.Style.Padding * 2 } - sections = append(sections, strings.Repeat("=", width)) + sections = append(sections, strings.Repeat(borderChar, width)) } border := t.Style.BorderColor.Render("+") @@ -260,8 +271,6 @@ func (t *Table) padText(text string, width int, alignment string) string { } } -// Convenience methods for creating common table types - // NewServicesTable creates a table optimized for service listings with lipgloss styling func NewServicesTable(colorizer *Colorizer, iconRenderer *IconRenderer) *Table { table := NewTable(colorizer, iconRenderer)