Skip to content

table: how to add border to heading only? #246

Answered by maaslalani
bashbunni asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! So the StyleFunc is used to style each cell which is why when you apply a border to the cell it tries to add a border to each cell and gives you that weird result. We should probably handle this a little bit better.

The BorderHeader is applied with the Border supplied on the border so when given lipgloss.HiddenBorder the BorderHeader also applies with a hidden border. This is so that it is consistent with the rest of the table.

I think this can be solved through a custom border, would this style be good?

If so, the following custom border can be used:

Border(lipgloss.Border{
	Top:          "─",
	Bottom:       " ",
	Left:         " ",
	Right:        " ",
	TopLeft:      "─",
	TopRight:…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by bashbunni
Comment options

You must be logged in to vote
1 reply
@bashbunni
Comment options

bashbunni Jan 5, 2024
Maintainer Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants