Skip to content

Format colgroups #1374

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

Merged
merged 4 commits into from
Aug 13, 2025
Merged

Format colgroups #1374

merged 4 commits into from
Aug 13, 2025

Conversation

Jolanrensen
Copy link
Collaborator

@Jolanrensen Jolanrensen commented Aug 11, 2025

Fixes #1356

Now you can actually do this:

df
    .format().with { background(white) }
    .format { age }.with { background(blue) and textColor(white) }
    .format { name }.with { background(green) }
    .format { name.firstName }.with { italic and underline }
    .format { name.colsOf<String>() }.where { it.startsWith("C") }.with { background(red) }
image

Note, this does not solve #982 yet

…columns by name, so column groups can now also be targeted and used. I turned the gathered attributes into a map, such that duplicate keys are removed. Only the latest ones stay, meaning you can overwrite previous attributes for a cell.
@Jolanrensen Jolanrensen marked this pull request as ready for review August 11, 2025 20:02
@koperagen
Copy link
Collaborator

koperagen commented Aug 12, 2025

This now formats both firstName and lastName?
df.format { name }.with { italic and underline }
If so, add "Columns inherit formatting from containing column group" or "Formatting a ColumnGroup applies to all its children (or nested columns)"

@Jolanrensen
Copy link
Collaborator Author

Jolanrensen commented Aug 12, 2025

This now formats both firstName and lastName? df.format { name }.with { italic and underline } If so, add "Columns inherit formatting from containing column group" or "Formatting a ColumnGroup applies to all its children (or nested columns)"

I shall expand the kdocs a bit :)

Copy link
Collaborator

@AndreiKingsley AndreiKingsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! But yeah, need to describe behavior.

@Jolanrensen
Copy link
Collaborator Author

I'll also update the documentation site btw, I forgot about that, then I'll merge :)

@Jolanrensen Jolanrensen merged commit c043b2d into master Aug 13, 2025
6 checks passed
@Jolanrensen Jolanrensen deleted the format-colgroups branch August 13, 2025 10:50
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

Successfully merging this pull request may close these issues.

format { col.group } impossible
4 participants