Skip to content

Hiding header columns breaks the table #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zthreee opened this issue Feb 9, 2025 · 0 comments
Open

Hiding header columns breaks the table #191

zthreee opened this issue Feb 9, 2025 · 0 comments

Comments

@zthreee
Copy link

zthreee commented Feb 9, 2025

Hey, not sure if I am doing something wrong, but I am trying to draw only the bottom border on the headers, without top/left/right ones.

I tried with:

func headerStyle() lipgloss.Style {
	return lipgloss.NewStyle().
		BorderStyle(lipgloss.HiddenBorder()).
		BorderForeground(lipgloss.Color("240")).
		Foreground(lipgloss.Color("#666666"))
}

That does nothing.

I am setting it up this way:

func initializeTable() table.Model {
	t := table.New(tableColumns()).
		HeaderStyle(headerStyle()).
		WithRows([]table.Row{
			table.NewRow(table.RowData{
				"date_key": parsers.FormatRelativeTime(time.Now()),
				"type_key": "buy",
				"usd_key":  "12.2",
				"token_key":  "100M",
				"sol_key":  "10.3",
			}),
		}).
		WithBaseStyle(styleBase).
		WithRowStyleFunc(rowStyleFunc)

	return t
}

When i set:

func headerStyle() lipgloss.Style {
	return lipgloss.NewStyle().
		BorderStyle(lipgloss.HiddenBorder()).
		BorderTop(false).
		BorderForeground(lipgloss.Color("240")).
		Foreground(lipgloss.Color("#666666"))
}

Table totally breaks:

Image

I tried to also setup the header style directly on each column, and when doing:

func headerStyle() lipgloss.Style {
	return lipgloss.NewStyle().
		BorderStyle(lipgloss.HiddenBorder()).
		BorderTop(false).
		BorderLeft(false).
		BorderRight(false).
		BorderForeground(lipgloss.Color("240")).
		Foreground(lipgloss.Color("#666666"))
}

Nothing changes fromt he example, when I disable only the TopBorder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant