Skip to content

Border color when title is used #234

Closed
@alajmo

Description

@alajmo

Describe the bug
No way to set border style for title.

To Reproduce

package main

import (
    "os"

    "github.com/jedib0t/go-pretty/v6/text"
    "github.com/jedib0t/go-pretty/v6/table"
)

func main() {
    t := table.NewWriter()
    t.SetOutputMirror(os.Stdout)
    t.AppendHeader(table.Row{"#", "First Name", "Last Name", "Salary"})
    t.AppendRows([]table.Row{
        {1, "Arya", "Stark", 3000},
        {20, "Jon", "Snow", 2000, "You know nothing, Jon Snow!"},
    })
    t.AppendSeparator()
    t.AppendRow([]interface{}{300, "Tyrion", "Lannister", 5000})
    t.AppendFooter(table.Row{"", "", "Total", 10000})
    t.SetTitle("title test")
    t.Style().Title.Colors = text.Colors{text.Faint}
    t.Style().Color = table.ColorOptions{
		Header: text.Colors{text.Faint},
		Row: text.Colors{text.Faint},
		RowAlternate: text.Colors{text.Faint},
		Footer: text.Colors{text.Faint},
    }

    t.Render()
}

Expected behavior
I expect to be able to color the top portion of the border.

Screenshots
border

Software (please complete the following information):

  • OS: Linux 5.18.0-2-amd64 Debian 5.18.5-1 (2022-06-16) x86_64 GNU/Linux
  • GoLang Version: go version go1.18 linux/amd64

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions