bubbles icon indicating copy to clipboard operation
bubbles copied to clipboard

feat(table): More granular table styles #246

Open pja237 opened this issue 2 years ago • 3 comments

@jlec et al. PR regarding #246

This was an idea of how one might extend the table styling without causing too much havoc in the table code and to maintain backwards compatibility. I'm more then happy to receive feedback, ideas and pointers on how to make this better and eventually merged.

pja237 avatar Feb 27 '23 21:02 pja237

This week is nuts. Hopefully, on the weekend, I will be able to tinker with your code

jlec avatar Mar 02 '23 08:03 jlec

Works for me. docs are missing.

jlec avatar Mar 05 '23 21:03 jlec

Part of me wonders if it would be more streamlined to extend the existing Styles struct to include an optional value for Row. It looks like there are already options for Selected and Cell in the Styles struct. The user would be able to set these styles to whatever lipgloss.Style definitions they'd like when they initialize the table.

The Row field could probably just initialize a new style (lipgloss.NewStyle()), so all fields could call lipgloss.Render without issue and users can add their own customizations without it breaking. Let me know your thoughts on that

bashbunni avatar Mar 24 '23 21:03 bashbunni

Hey @pja237, thanks so much for this contribution.

Our plan is to replace the table renderer with Lip Gloss tables which will allow fully customizable Cell and Row styles with the StyleFunc.

I am going to close this PR for now (doing some cleaning up) but feel free to re-open this or create new issues / PRs if needed!

maaslalani avatar Feb 28 '24 17:02 maaslalani

Here is the Lip Gloss table documentation for reference:

https://github.com/charmbracelet/lipgloss/tree/master?tab=readme-ov-file#rendering-tables

maaslalani avatar Feb 28 '24 17:02 maaslalani